diff --git a/cli/app/deploy.go b/cli/app/deploy.go index 5d91f704..8ae945e8 100644 --- a/cli/app/deploy.go +++ b/cli/app/deploy.go @@ -179,7 +179,9 @@ checkout as-is. Recipe commit hashes are also supported as values for appPkg.ExposeAllEnv(stackName, compose, app.Env) appPkg.SetRecipeLabel(compose, stackName, app.Recipe.Name) appPkg.SetChaosLabel(compose, stackName, internal.Chaos) - appPkg.SetChaosVersionLabel(compose, stackName, toDeployChaosVersionLabel) + if internal.Chaos { + appPkg.SetChaosVersionLabel(compose, stackName, toDeployChaosVersionLabel) + } appPkg.SetUpdateLabel(compose, stackName, app.Env) envVars, err := appPkg.CheckEnv(app) diff --git a/cli/app/rollback.go b/cli/app/rollback.go index 9213562d..9adc854e 100644 --- a/cli/app/rollback.go +++ b/cli/app/rollback.go @@ -178,7 +178,9 @@ beforehand. See "abra app backup" for more.`, appPkg.ExposeAllEnv(stackName, compose, app.Env) appPkg.SetRecipeLabel(compose, stackName, app.Recipe.Name) appPkg.SetChaosLabel(compose, stackName, internal.Chaos) - appPkg.SetChaosVersionLabel(compose, stackName, chosenDowngrade) + if internal.Chaos { + appPkg.SetChaosVersionLabel(compose, stackName, chosenDowngrade) + } appPkg.SetUpdateLabel(compose, stackName, app.Env) chaosVersion := config.CHAOS_DEFAULT diff --git a/cli/app/upgrade.go b/cli/app/upgrade.go index 6d8ec37c..ce116c04 100644 --- a/cli/app/upgrade.go +++ b/cli/app/upgrade.go @@ -183,7 +183,9 @@ beforehand. See "abra app backup" for more.`, appPkg.ExposeAllEnv(stackName, compose, app.Env) appPkg.SetRecipeLabel(compose, stackName, app.Recipe.Name) appPkg.SetChaosLabel(compose, stackName, internal.Chaos) - appPkg.SetChaosVersionLabel(compose, stackName, chosenUpgrade) + if internal.Chaos { + appPkg.SetChaosVersionLabel(compose, stackName, chosenUpgrade) + } appPkg.SetUpdateLabel(compose, stackName, app.Env) envVars, err := appPkg.CheckEnv(app) diff --git a/tests/integration/app_deploy.bats b/tests/integration/app_deploy.bats index c2626628..fd67fe7b 100644 --- a/tests/integration/app_deploy.bats +++ b/tests/integration/app_deploy.bats @@ -429,3 +429,12 @@ teardown(){ assert_success assert_output --partial "$latestRelease" } + +# bats test_tags=slow +@test "no chaos version label if no chaos" { + _deploy_app + + run $ABRA app labels "$TEST_APP_DOMAIN" --no-input + assert_success + refute_output --regexp "coop-cloud.abra-test-recipe.$TEST_SERVER.chaos-version" +} diff --git a/tests/integration/app_rollback.bats b/tests/integration/app_rollback.bats index b4d30b20..8658caa3 100644 --- a/tests/integration/app_rollback.bats +++ b/tests/integration/app_rollback.bats @@ -185,3 +185,16 @@ teardown(){ assert_failure assert_output --partial "not a known version" } + +# bats test_tags=slow +@test "no chaos version label if no chaos" { + _deploy_app + + run $ABRA app rollback "$TEST_APP_DOMAIN" \ + --no-input --no-converge-checks + assert_success + + run $ABRA app labels "$TEST_APP_DOMAIN" --no-input + assert_success + refute_output --regexp "coop-cloud.abra-test-recipe.$TEST_SERVER.chaos-version" +} diff --git a/tests/integration/app_upgrade.bats b/tests/integration/app_upgrade.bats index 8e3c0b2e..100f33ad 100644 --- a/tests/integration/app_upgrade.bats +++ b/tests/integration/app_upgrade.bats @@ -239,3 +239,16 @@ teardown(){ assert_failure assert_output --partial "not a known version" } + +# bats test_tags=slow +@test "no chaos version label if no chaos" { + _deploy_app + + run $ABRA app upgrade "$TEST_APP_DOMAIN" \ + --no-input --no-converge-checks + assert_success + + run $ABRA app labels "$TEST_APP_DOMAIN" --no-input + assert_success + refute_output --regexp "coop-cloud.abra-test-recipe.$TEST_SERVER.chaos-version" +}