fix: respond to all review comments
This commit is contained in:
committed by
Michael Hobbs
parent
1e8831d9a0
commit
72eb8a06f0
@@ -162,7 +162,7 @@ func ContainerIsRunning(containerId string) bool {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return string(b[:]) == "true"
|
return strings.TrimSpace(string(b[:])) == "true"
|
||||||
}
|
}
|
||||||
|
|
||||||
// DirectoryExists returns if a path exists and is a directory
|
// DirectoryExists returns if a path exists and is a directory
|
||||||
@@ -234,7 +234,7 @@ func FileExists(filePath string) bool {
|
|||||||
return fi.Mode().IsRegular()
|
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) {
|
func GetAppImageName(appName, imageTag, imageRepo string) (imageName string) {
|
||||||
err := VerifyAppName(appName)
|
err := VerifyAppName(appName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -302,7 +302,7 @@ func LogInfo1(text string) {
|
|||||||
fmt.Fprintln(os.Stdout, fmt.Sprintf("-----> %s", text))
|
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) {
|
func LogInfo1Quiet(text string) {
|
||||||
if os.Getenv("DOKKU_QUIET_OUTPUT") != "" {
|
if os.Getenv("DOKKU_QUIET_OUTPUT") != "" {
|
||||||
LogInfo1(text)
|
LogInfo1(text)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ func GetContainerIpaddress(appName string, procType string, isHerokuishContainer
|
|||||||
|
|
||||||
b, err := imageCmd.Output()
|
b, err := imageCmd.Output()
|
||||||
if err != nil || len(b) == 0 {
|
if err != nil || len(b) == 0 {
|
||||||
// docker < .19 compatibility
|
// docker < 1.9 compatibility
|
||||||
imageCmd = common.NewShellCmd(strings.Join([]string{
|
imageCmd = common.NewShellCmd(strings.Join([]string{
|
||||||
"docker",
|
"docker",
|
||||||
"inspect",
|
"inspect",
|
||||||
@@ -124,7 +124,7 @@ func BuildConfig(appName string) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
procParts := strings.SplitAfterN(line, ":", 2)
|
procParts := strings.SplitN(line, "=", 2)
|
||||||
if len(procParts) != 2 {
|
if len(procParts) != 2 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -135,7 +135,7 @@ func BuildConfig(appName string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
containerIndex := 0
|
containerIndex := 0
|
||||||
for containerIndex <= procCount {
|
for containerIndex < procCount {
|
||||||
containerIndex += 1
|
containerIndex += 1
|
||||||
containerIdFile := fmt.Sprintf("%v/CONTAINER.%v.%v", appRoot, procType, containerIndex)
|
containerIdFile := fmt.Sprintf("%v/CONTAINER.%v.%v", appRoot, procType, containerIndex)
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
common.LogFail(err.Error())
|
common.LogFail(err.Error())
|
||||||
}
|
}
|
||||||
|
defer f.Close()
|
||||||
|
|
||||||
ipBytes := []byte(ip)
|
ipBytes := []byte(ip)
|
||||||
_, err = f.Write(ipBytes)
|
_, err = f.Write(ipBytes)
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
common.LogFail(err.Error())
|
common.LogFail(err.Error())
|
||||||
}
|
}
|
||||||
|
defer f.Close()
|
||||||
|
|
||||||
portBytes := []byte(port)
|
portBytes := []byte(port)
|
||||||
_, err = f.Write(portBytes)
|
_, err = f.Write(portBytes)
|
||||||
|
|||||||
Reference in New Issue
Block a user