fix: correct lint errors
This commit is contained in:
1 parent
3b9f4ba63f
commit
a3abf8016b
3 files changed
+10
-10
No files matched your search
@@ -157,8 +157,8 @@ func VerifyImage(image string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ContainerIsRunning checks to see if a container is running
|
// ContainerIsRunning checks to see if a container is running
|
||||||
func ContainerIsRunning(containerId string) bool {
|
func ContainerIsRunning(containerID string) bool {
|
||||||
b, err := DockerInspect(containerId, "'{{.State.Running}}'")
|
b, err := DockerInspect(containerID, "'{{.State.Running}}'")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@@ -176,13 +176,13 @@ func DirectoryExists(filePath string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// DockerInspect runs an inspect command with a given format against a container id
|
// DockerInspect runs an inspect command with a given format against a container id
|
||||||
func DockerInspect(containerId, format string) (string, error) {
|
func DockerInspect(containerID, format string) (string, error) {
|
||||||
b, err := sh.Command("docker", "inspect", "--format", format, containerId).Output()
|
b, err := sh.Command("docker", "inspect", "--format", format, containerID).Output()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
output := strings.TrimSpace(string(b[:]))
|
output := strings.TrimSpace(string(b[:]))
|
||||||
if strings.HasPrefix(output, "'") && strings.HasSuffix(output, "'") {
|
if strings.HasPrefix(output, "'") && strings.HasSuffix(output, "'") {
|
||||||
output = strings.TrimSuffix(strings.TrimPrefix(output, "'"), "'")
|
output = strings.TrimSuffix(strings.TrimPrefix(output, "'"), "'")
|
||||||
}
|
}
|
||||||
return output, err
|
return output, err
|
||||||
@@ -270,7 +270,7 @@ func GetAppImageName(appName, imageTag, imageRepo string) (imageName string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// return true if given app has a running container
|
// IsDeployed returns true if given app has a running container
|
||||||
func IsDeployed(appName string) bool {
|
func IsDeployed(appName string) bool {
|
||||||
dokkuRoot := MustGetEnv("DOKKU_ROOT")
|
dokkuRoot := MustGetEnv("DOKKU_ROOT")
|
||||||
appRoot := strings.Join([]string{dokkuRoot, appName}, "/")
|
appRoot := strings.Join([]string{dokkuRoot, appName}, "/")
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ func main() {
|
|||||||
appName := flag.Arg(0)
|
appName := flag.Arg(0)
|
||||||
procType := flag.Arg(1)
|
procType := flag.Arg(1)
|
||||||
isHerokuishContainer := common.ToBool(flag.Arg(2))
|
isHerokuishContainer := common.ToBool(flag.Arg(2))
|
||||||
containerId := flag.Arg(3)
|
containerID := flag.Arg(3)
|
||||||
|
|
||||||
ipAddress := network.GetContainerIpaddress(appName, procType, isHerokuishContainer, containerId)
|
ipAddress := network.GetContainerIpaddress(appName, procType, isHerokuishContainer, containerID)
|
||||||
fmt.Fprintln(os.Stdout, ipAddress)
|
fmt.Fprintln(os.Stdout, ipAddress)
|
||||||
}
|
}
|
||||||
@@ -15,8 +15,8 @@ func main() {
|
|||||||
appName := flag.Arg(0)
|
appName := flag.Arg(0)
|
||||||
procType := flag.Arg(1)
|
procType := flag.Arg(1)
|
||||||
isHerokuishContainer := common.ToBool(flag.Arg(2))
|
isHerokuishContainer := common.ToBool(flag.Arg(2))
|
||||||
containerId := flag.Arg(3)
|
containerID := flag.Arg(3)
|
||||||
|
|
||||||
port := network.GetContainerPort(appName, procType, isHerokuishContainer, containerId)
|
port := network.GetContainerPort(appName, procType, isHerokuishContainer, containerID)
|
||||||
fmt.Fprintln(os.Stdout, port)
|
fmt.Fprintln(os.Stdout, port)
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user