fix: respond to all review comments

This commit is contained in:
Jose Diaz-Gonzalez
2017-04-26 18:49:19 -06:00
committed by Michael Hobbs
parent 1e8831d9a0
commit 72eb8a06f0
4 changed files with 8 additions and 6 deletions

View File

@@ -162,7 +162,7 @@ func ContainerIsRunning(containerId string) bool {
if err != nil {
return false
}
return string(b[:]) == "true"
return strings.TrimSpace(string(b[:])) == "true"
}
// DirectoryExists returns if a path exists and is a directory
@@ -234,7 +234,7 @@ func FileExists(filePath string) bool {
return fi.Mode().IsRegular()
}
// GetAppImageName returnS image identifier for a given app, tag tuple. validate if tag is presented
// GetAppImageName returns image identifier for a given app, tag tuple. validate if tag is presented
func GetAppImageName(appName, imageTag, imageRepo string) (imageName string) {
err := VerifyAppName(appName)
if err != nil {
@@ -302,7 +302,7 @@ func LogInfo1(text string) {
fmt.Fprintln(os.Stdout, fmt.Sprintf("-----> %s", text))
}
// LogInfo2Quiet is the info1 header formatter (with quiet option)
// LogInfo1Quiet is the info1 header formatter (with quiet option)
func LogInfo1Quiet(text string) {
if os.Getenv("DOKKU_QUIET_OUTPUT") != "" {
LogInfo1(text)

View File

@@ -33,7 +33,7 @@ func GetContainerIpaddress(appName string, procType string, isHerokuishContainer
b, err := imageCmd.Output()
if err != nil || len(b) == 0 {
// docker < .19 compatibility
// docker < 1.9 compatibility
imageCmd = common.NewShellCmd(strings.Join([]string{
"docker",
"inspect",
@@ -124,7 +124,7 @@ func BuildConfig(appName string) {
continue
}
procParts := strings.SplitAfterN(line, ":", 2)
procParts := strings.SplitN(line, "=", 2)
if len(procParts) != 2 {
continue
}
@@ -135,7 +135,7 @@ func BuildConfig(appName string) {
}
containerIndex := 0
for containerIndex <= procCount {
for containerIndex < procCount {
containerIndex += 1
containerIdFile := fmt.Sprintf("%v/CONTAINER.%v.%v", appRoot, procType, containerIndex)

View File

@@ -31,6 +31,7 @@ func main() {
if err != nil {
common.LogFail(err.Error())
}
defer f.Close()
ipBytes := []byte(ip)
_, err = f.Write(ipBytes)

View File

@@ -31,6 +31,7 @@ func main() {
if err != nil {
common.LogFail(err.Error())
}
defer f.Close()
portBytes := []byte(port)
_, err = f.Write(portBytes)