mirror of
https://github.com/yusing/godoxy.git
synced 2025-06-04 02:42:34 +02:00
container now consider explicit if any proxy label defined
This commit is contained in:
parent
8aa831804b
commit
eac3afba52
1 changed files with 7 additions and 1 deletions
|
@ -45,8 +45,14 @@ type (
|
||||||
var DummyContainer = new(Container)
|
var DummyContainer = new(Container)
|
||||||
|
|
||||||
func FromDocker(c *types.Container, dockerHost string) (res *Container) {
|
func FromDocker(c *types.Container, dockerHost string) (res *Container) {
|
||||||
isExplicit := c.Labels[LabelAliases] != ""
|
isExplicit := false
|
||||||
helper := containerHelper{c}
|
helper := containerHelper{c}
|
||||||
|
for lbl := range c.Labels {
|
||||||
|
if strings.HasPrefix(lbl, NSProxy+".") {
|
||||||
|
isExplicit = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
res = &Container{
|
res = &Container{
|
||||||
DockerHost: dockerHost,
|
DockerHost: dockerHost,
|
||||||
ContainerName: helper.getName(),
|
ContainerName: helper.getName(),
|
||||||
|
|
Loading…
Add table
Reference in a new issue