Merge pull request #9235 from Luap99/fix-9234

Fix podman network disconnect wrong NetworkStatus number
This commit is contained in:
OpenShift Merge Robot
2021-02-04 16:34:45 -05:00
committed by GitHub
2 changed files with 21 additions and 1 deletions

View File

@ -1180,7 +1180,7 @@ func (c *Container) NetworkDisconnect(nameOrID, netName string, force bool) erro
// update network status if container is not running
networkStatus := c.state.NetworkStatus
// clip out the index of the network
tmpNetworkStatus := make([]*cnitypes.Result, len(networkStatus)-1)
tmpNetworkStatus := make([]*cnitypes.Result, 0, len(networkStatus)-1)
for k, v := range networkStatus {
if index != k {
tmpNetworkStatus = append(tmpNetworkStatus, v)