diff --git a/plugins/common/common.go b/plugins/common/common.go index e169d972f..e0ffb613e 100644 --- a/plugins/common/common.go +++ b/plugins/common/common.go @@ -390,8 +390,8 @@ func ParseReportArgs(pluginName string, arguments []string) ([]string, string, e } // ParseScaleOutput allows golang plugins to properly parse the output of ps-current-scale -func ParseScaleOutput(b []byte) (map[string]int, error) { - scale := make(map[string]int) +func ParseScaleOutput(b []byte) (map[string]int32, error) { + scale := make(map[string]int32) for _, line := range strings.Split(string(b), "\n") { s := strings.SplitN(line, "=", 2) @@ -399,11 +399,11 @@ func ParseScaleOutput(b []byte) (map[string]int, error) { return scale, fmt.Errorf("invalid scale output stored by dokku: %v", line) } processType := s[0] - count, err := strconv.Atoi(s[1]) + count, err := strconv.ParseInt(s[1], 10, 32) if err != nil { return scale, err } - scale[processType] = count + scale[processType] = int32(count) } return scale, nil diff --git a/plugins/network/network.go b/plugins/network/network.go index 13b1ed54b..f8bf2d1dc 100644 --- a/plugins/network/network.go +++ b/plugins/network/network.go @@ -64,10 +64,10 @@ func BuildConfig(appName string) error { common.LogInfo1(fmt.Sprintf("Ensuring network configuration is in sync for %s", appName)) for processType, procCount := range scale { - containerIndex := 0 + containerIndex := int32(0) for containerIndex < procCount { containerIndex++ - containerIndexString := strconv.Itoa(containerIndex) + containerIndexString := strconv.FormatInt(int64(containerIndex), 10) containerIDFile := fmt.Sprintf("%v/CONTAINER.%v.%v", appRoot, processType, containerIndex) containerID := common.ReadFirstLine(containerIDFile)