portmap DEL noop if no portMappings present
if the runtime is not passing portMappings in the runtimeConfig, then DEL is a noop. This solves performance issues, when the portmap plugin is executed multiple times, holding the iptables lock, despite it does not have anything to delete. Signed-off-by: Antonio Ojea <aojea@redhat.com>
This commit is contained in:
parent
c90b165c6e
commit
877602d627
@ -107,6 +107,10 @@ func cmdDel(args *skel.CmdArgs) error {
|
|||||||
return fmt.Errorf("failed to parse config: %v", err)
|
return fmt.Errorf("failed to parse config: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(netConf.RuntimeConfig.PortMaps) == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
netConf.ContainerID = args.ContainerID
|
netConf.ContainerID = args.ContainerID
|
||||||
|
|
||||||
// We don't need to parse out whether or not we're using v6 or snat,
|
// We don't need to parse out whether or not we're using v6 or snat,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user