Skip to content

Commit

Permalink
negate CheckDeleteNet(... output
Browse files Browse the repository at this point in the history
  • Loading branch information
steiler committed Jun 18, 2021
1 parent a3a370c commit 1342ae9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion runtime/containerd/containerd.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (c *ContainerdRuntime) CreateNet(ctx context.Context) error {
func (c *ContainerdRuntime) CheckDeleteNet(ctx context.Context) (string, bool, error) {
bridgename := c.Mgmt.Bridge
brInUse, err := utils.CheckBrInUse(bridgename)
return bridgename, c.keepMgmtNet || brInUse, err
return bridgename, !(c.keepMgmtNet || brInUse), err
}

func (c *ContainerdRuntime) DeleteNet(ctx context.Context) error {
Expand Down
2 changes: 1 addition & 1 deletion runtime/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func (c *DockerRuntime) CreateNet(ctx context.Context) (err error) {

func (c *DockerRuntime) CheckDeleteNet(ctx context.Context) (string, bool, error) {
network := c.Mgmt.Network
return network, network == "bridge" || c.keepMgmtNet, nil
return network, !(network == "bridge" || c.keepMgmtNet), nil
}

// DeleteNet deletes a docker bridge
Expand Down

0 comments on commit 1342ae9

Please sign in to comment.