Skip to content

Commit

Permalink
Merge pull request #707 from danwinship/checkPorts
Browse files Browse the repository at this point in the history
portmap: fix checkPorts result when chain does not exist
  • Loading branch information
squeed authored Feb 23, 2022
2 parents 76307bf + 08d0f33 commit 9f67faf
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions plugins/meta/portmap/portmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,26 +127,12 @@ func checkPorts(config *PortMapConf, containerNet net.IPNet) error {
}

if ip4t != nil {
exists, err := utils.ChainExists(ip4t, dnatChain.table, dnatChain.name)
if err != nil {
return err
}
if !exists {
return err
}
if err := dnatChain.check(ip4t); err != nil {
return fmt.Errorf("could not check ipv4 dnat: %v", err)
}
}

if ip6t != nil {
exists, err := utils.ChainExists(ip6t, dnatChain.table, dnatChain.name)
if err != nil {
return err
}
if !exists {
return err
}
if err := dnatChain.check(ip6t); err != nil {
return fmt.Errorf("could not check ipv6 dnat: %v", err)
}
Expand Down

0 comments on commit 9f67faf

Please sign in to comment.