Merge pull request #3014 from dokku/dockerfile-network-ports
fix: handle case where DOKKU_DOCKERFILE_PORTS is an empty string
This commit is contained in:
1 file changed
+5
-1
@@ -5,6 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
"unicode/utf8"
|
||||||
|
|
||||||
"github.com/dokku/dokku/plugins/common"
|
"github.com/dokku/dokku/plugins/common"
|
||||||
"github.com/dokku/dokku/plugins/config"
|
"github.com/dokku/dokku/plugins/config"
|
||||||
@@ -23,7 +24,10 @@ func main() {
|
|||||||
|
|
||||||
var dockerfilePorts []string
|
var dockerfilePorts []string
|
||||||
if !isHerokuishContainer {
|
if !isHerokuishContainer {
|
||||||
dockerfilePorts = strings.Split(config.GetWithDefault(appName, "DOKKU_DOCKERFILE_PORTS", ""), " ")
|
dokkuDockerfilePorts := strings.Trim(config.GetWithDefault(appName, "DOKKU_DOCKERFILE_PORTS", ""), " ")
|
||||||
|
if utf8.RuneCountInString(dokkuDockerfilePorts) > 0 {
|
||||||
|
dockerfilePorts = strings.Split(dokkuDockerfilePorts, " ")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var ports []string
|
var ports []string
|
||||||
|
|||||||
Reference in new issue
Block a user