Skip to content

Commit

Permalink
Merge pull request #4086 from mheon/cni_del_on_refresh
Browse files Browse the repository at this point in the history
Force a CNI Delete on refreshing containers
  • Loading branch information
openshift-merge-robot authored Sep 25, 2019
2 parents 525be7d + b57d2f4 commit e4835f6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libpod/container_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ func (c *Container) refresh() error {
return err
}

return nil
return c.refreshCNI()
}

// Remove conmon attach socket and terminal resize FIFO
Expand Down
7 changes: 7 additions & 0 deletions libpod/container_internal_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -1325,3 +1325,10 @@ func (c *Container) copyOwnerAndPerms(source, dest string) error {
}
return nil
}

// Teardown CNI config on refresh
func (c *Container) refreshCNI() error {
// Let's try and delete any lingering network config...
podNetwork := c.runtime.getPodNetwork(c.ID(), c.config.Name, "", c.config.Networks, c.config.PortMappings, c.config.StaticIP)
return c.runtime.netPlugin.TearDownPod(podNetwork)
}
4 changes: 4 additions & 0 deletions libpod/container_internal_unsupported.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@ func (c *Container) restore(ctx context.Context, options ContainerCheckpointOpti
func (c *Container) copyOwnerAndPerms(source, dest string) error {
return nil
}

func (c *Container) refreshCNI() error {
return define.ErrNotImplemented
}

0 comments on commit e4835f6

Please sign in to comment.