mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-13 21:56:38 +01:00
Add ability to overrider depending containers with special label (#489)
* Add ability to overrider depending containers with special label * Add documentation of how to override container dependencies with special label
This commit is contained in:
parent
7b0d311799
commit
b32cb5d35d
4 changed files with 64 additions and 1 deletions
|
|
@ -95,6 +95,13 @@ func (c Container) Enabled() (bool, bool) {
|
|||
func (c Container) Links() []string {
|
||||
var links []string
|
||||
|
||||
dependsOnLabelValue := c.getLabelValueOrEmpty(dependsOnLabel)
|
||||
|
||||
if dependsOnLabelValue != "" {
|
||||
links := strings.Split(dependsOnLabelValue, ",")
|
||||
return links
|
||||
}
|
||||
|
||||
if (c.containerInfo != nil) && (c.containerInfo.HostConfig != nil) {
|
||||
for _, link := range c.containerInfo.HostConfig.Links {
|
||||
name := strings.Split(link, ":")[0]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue