libnetwork/iptables: IPTable.RemoveExistingChain() slight refactor

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-07-05 15:38:57 +02:00
parent 04e54c6bb0
commit ea4baa24b1
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -275,14 +275,14 @@ func (iptable IPTable) ProgramChain(c *ChainInfo, bridgeName string, hairpinMode
// RemoveExistingChain removes existing chain from the table.
func (iptable IPTable) RemoveExistingChain(name string, table Table) error {
if table == "" {
table = Filter
}
c := &ChainInfo{
Name: name,
Table: table,
IPTable: iptable,
}
if string(c.Table) == "" {
c.Table = Filter
}
return c.Remove()
}