mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-16 15:10:12 +01:00
Verify that network_mode == container
Co-authored-by: nils måsén <nils@piksel.se>
This commit is contained in:
parent
d1bb4da50c
commit
683d672c59
1 changed files with 1 additions and 1 deletions
|
|
@ -158,7 +158,7 @@ func (client dockerClient) GetContainer(containerID t.ContainerID) (t.Container,
|
|||
}
|
||||
|
||||
containerNetworkMode := strings.Split(string(containerInfo.HostConfig.NetworkMode), ":")
|
||||
if len(containerNetworkMode) == 2 {
|
||||
if len(containerNetworkMode) == 2 && containerNetworkMode[0] == "container" {
|
||||
parentContainer, err := client.api.ContainerInspect(bg, containerNetworkMode[1])
|
||||
if err != nil {
|
||||
log.Debug("Unable to fetch parentContainer.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue