refactor out variadic form of GetDeployingAppImageName

This commit is contained in:
Michael Hobbs
2017-01-14 13:34:34 -08:00
parent b6dffaabee
commit dffbad49b4
2 changed files with 2 additions and 10 deletions

View File

@@ -82,15 +82,7 @@ func LogFail(text string) {
}
// GetDeployingAppImageName returns deploying image identifier for a given app, tag tuple. validate if tag is presented
func GetDeployingAppImageName(args ...string) (imageName string) {
argArray := make([]string, 3)
for idx, arg := range args {
argArray[idx] = arg
}
appName := argArray[0]
imageTag := argArray[1]
imageRepo := argArray[2]
func GetDeployingAppImageName(appName, imageTag, imageRepo string) (imageName string) {
if appName == "" {
LogFail("(GetDeployingAppImageName) APP must not be empty")
}

View File

@@ -22,7 +22,7 @@ func purgeCache() {
cacheDir := strings.Join([]string{common.MustGetEnv("DOKKU_ROOT"), appName, "cache"}, "/")
dokkuGlobalRunArgs := common.MustGetEnv("DOKKU_GLOBAL_RUN_ARGS")
image := common.GetDeployingAppImageName(appName)
image := common.GetDeployingAppImageName(appName, "", "")
if info, _ := os.Stat(cacheDir); info != nil && info.IsDir() {
purgeCacheCmd := common.NewDokkuCmd(strings.Join([]string{"docker run --rm", dokkuGlobalRunArgs,
"-v", strings.Join([]string{cacheDir, ":/cache"}, ""), image,