fix: remove proxy enabled checks when retrieving a container's ip and port
This commit is contained in:
1 parent
3ca5503b74
commit
419d687c50
1 file changed
+2
-11
@@ -7,7 +7,6 @@ import (
|
|||||||
|
|
||||||
common "github.com/dokku/dokku/plugins/common"
|
common "github.com/dokku/dokku/plugins/common"
|
||||||
config "github.com/dokku/dokku/plugins/config"
|
config "github.com/dokku/dokku/plugins/config"
|
||||||
proxy "github.com/dokku/dokku/plugins/proxy"
|
|
||||||
|
|
||||||
sh "github.com/codeskyblue/go-sh"
|
sh "github.com/codeskyblue/go-sh"
|
||||||
)
|
)
|
||||||
@@ -99,11 +98,6 @@ func GetContainerIpaddress(appName string, procType string, containerID string)
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
ipAddress := "127.0.0.1"
|
|
||||||
if !proxy.IsAppProxyEnabled(appName) {
|
|
||||||
return ipAddress
|
|
||||||
}
|
|
||||||
|
|
||||||
b, err := common.DockerInspect(containerID, "'{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'")
|
b, err := common.DockerInspect(containerID, "'{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'")
|
||||||
if err != nil || len(b) == 0 {
|
if err != nil || len(b) == 0 {
|
||||||
// docker < 1.9 compatibility
|
// docker < 1.9 compatibility
|
||||||
@@ -143,15 +137,12 @@ func GetContainerPort(appName string, procType string, isHerokuishContainer bool
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
port = "5000"
|
|
||||||
}
|
|
||||||
|
|
||||||
if !proxy.IsAppProxyEnabled(appName) {
|
|
||||||
b, err := sh.Command("docker", "port", containerID, port).Output()
|
b, err := sh.Command("docker", "port", containerID, port).Output()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
port = strings.Split(string(b[:]), ":")[1]
|
port = strings.Split(string(b[:]), ":")[1]
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
port = "5000"
|
||||||
}
|
}
|
||||||
|
|
||||||
return port
|
return port
|
||||||
|
|||||||
Reference in new issue
Block a user