Skip to content

Commit

Permalink
Merge pull request #46702 from thaJeztah/24.0_backport_releaseNetwork…
Browse files Browse the repository at this point in the history
…_NetworkDisabled

[24.0 backport] daemon: release sandbox even when NetworkDisabled
  • Loading branch information
thaJeztah committed Oct 24, 2023
2 parents c2e7c32 + 05d95fd commit 9b20b1a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion daemon/container_operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -1027,10 +1027,17 @@ func (daemon *Daemon) getNetworkedContainer(containerID, connectedContainerID st

func (daemon *Daemon) releaseNetwork(container *container.Container) {
start := time.Now()
// If live-restore is enabled, the daemon cleans up dead containers when it starts up. In that case, the
// netController hasn't been initialized yet and so we can't proceed.
// TODO(aker): If we hit this case, the endpoint state won't be cleaned up (ie. no call to cleanOperationalData).
if daemon.netController == nil {
return
}
if container.HostConfig.NetworkMode.IsContainer() || container.Config.NetworkDisabled {
// If the container uses the network namespace of another container, it doesn't own it -- nothing to do here.
if container.HostConfig.NetworkMode.IsContainer() {
return
}
if container.NetworkSettings == nil {
return
}

Expand Down

0 comments on commit 9b20b1a

Please sign in to comment.