mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-13 21:56:38 +01:00
fix: always add missing slashes to link names (#1588)
This commit is contained in:
parent
bbbe04119c
commit
9470bf81c5
3 changed files with 17 additions and 8 deletions
|
|
@ -160,7 +160,14 @@ func (c Container) Links() []string {
|
|||
dependsOnLabelValue := c.getLabelValueOrEmpty(dependsOnLabel)
|
||||
|
||||
if dependsOnLabelValue != "" {
|
||||
links := strings.Split(dependsOnLabelValue, ",")
|
||||
for _, link := range strings.Split(dependsOnLabelValue, ",") {
|
||||
// Since the container names need to start with '/', let's prepend it if it's missing
|
||||
if !strings.HasPrefix(link, "/") {
|
||||
link = "/" + link
|
||||
}
|
||||
links = append(links, link)
|
||||
}
|
||||
|
||||
return links
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue