mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-13 21:56:38 +01:00
feat: support container network mode (#1429)
Co-authored-by: nils måsén <nils@piksel.se> Co-authored-by: Andreas Åhman <andreas.ahman@ingka.ikea.com>
This commit is contained in:
parent
bba9b2b100
commit
dca45f50cb
15 changed files with 1379 additions and 47 deletions
|
|
@ -196,6 +196,13 @@ func (c Container) Links() []string {
|
|||
name := strings.Split(link, ":")[0]
|
||||
links = append(links, name)
|
||||
}
|
||||
|
||||
// If the container uses another container for networking, it can be considered an implicit link
|
||||
// since the container would stop working if the network supplier were to be recreated
|
||||
networkMode := c.containerInfo.HostConfig.NetworkMode
|
||||
if networkMode.IsContainer() {
|
||||
links = append(links, networkMode.ConnectedContainer())
|
||||
}
|
||||
}
|
||||
|
||||
return links
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue