fix: convert the containerIndex to a string to ensure it is properly passed to the plugn trigger
This commit is contained in:
committed by
Michael Hobbs
parent
647efab2dd
commit
20dca9fd46
@@ -119,6 +119,7 @@ func BuildConfig(appName string) {
|
|||||||
containerIndex := 0
|
containerIndex := 0
|
||||||
for containerIndex < procCount {
|
for containerIndex < procCount {
|
||||||
containerIndex++
|
containerIndex++
|
||||||
|
containerIndexString := strconv.Itoa(containerIndex)
|
||||||
containerIDFile := fmt.Sprintf("%v/CONTAINER.%v.%v", appRoot, procType, containerIndex)
|
containerIDFile := fmt.Sprintf("%v/CONTAINER.%v.%v", appRoot, procType, containerIndex)
|
||||||
|
|
||||||
containerID := common.ReadFirstLine(containerIDFile)
|
containerID := common.ReadFirstLine(containerIDFile)
|
||||||
@@ -130,14 +131,14 @@ func BuildConfig(appName string) {
|
|||||||
port := GetContainerPort(appName, procType, isHerokuishContainer, containerID)
|
port := GetContainerPort(appName, procType, isHerokuishContainer, containerID)
|
||||||
|
|
||||||
if ipAddress != "" {
|
if ipAddress != "" {
|
||||||
_, err := sh.Command("plugn", "trigger", "network-write-ipaddr", appName, procType, containerIndex, ipAddress).Output()
|
_, err := sh.Command("plugn", "trigger", "network-write-ipaddr", appName, procType, containerIndexString, ipAddress).Output()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
common.LogWarn(err.Error())
|
common.LogWarn(err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if port != "" {
|
if port != "" {
|
||||||
_, err := sh.Command("plugn", "trigger", "network-write-port", appName, procType, containerIndex, port).Output()
|
_, err := sh.Command("plugn", "trigger", "network-write-port", appName, procType, containerIndexString, port).Output()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
common.LogWarn(err.Error())
|
common.LogWarn(err.Error())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user