forked from toolshed/abra
fix!: chaos consistency (deploy/undeploy/rollback/upgrade)
See coop-cloud/organising#559 --chaos for rollback/upgrade goes away.
This commit is contained in:
@ -71,7 +71,7 @@ recipes.
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
isDeployed, deployedVersion, err := stack.IsDeployed(context.Background(), cl, stackName)
|
||||
deployMeta, err := stack.IsDeployed(context.Background(), cl, stackName)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@ -80,7 +80,7 @@ recipes.
|
||||
// is because we need to deal with GetComposeFiles under the hood and these
|
||||
// files change from version to version which therefore affects which
|
||||
// secrets might be generated
|
||||
version := deployedVersion
|
||||
version := deployMeta.Version
|
||||
if specificVersion != "" {
|
||||
version = specificVersion
|
||||
log.Debugf("choosing %s as version to deploy", version)
|
||||
@ -100,7 +100,7 @@ recipes.
|
||||
}
|
||||
}
|
||||
|
||||
if isDeployed {
|
||||
if deployMeta.IsDeployed {
|
||||
if internal.Force || internal.Chaos {
|
||||
log.Warnf("%s is already deployed but continuing (--force/--chaos)", app.Name)
|
||||
} else {
|
||||
@ -147,10 +147,11 @@ recipes.
|
||||
}
|
||||
}
|
||||
|
||||
chaosVersion := "false"
|
||||
if internal.Chaos {
|
||||
log.Warnf("chaos mode engaged")
|
||||
var err error
|
||||
version, err = app.Recipe.ChaosVersion()
|
||||
chaosVersion, err = app.Recipe.ChaosVersion()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@ -184,7 +185,7 @@ recipes.
|
||||
appPkg.ExposeAllEnv(stackName, compose, app.Env)
|
||||
appPkg.SetRecipeLabel(compose, stackName, app.Recipe.Name)
|
||||
appPkg.SetChaosLabel(compose, stackName, internal.Chaos)
|
||||
appPkg.SetChaosVersionLabel(compose, stackName, version)
|
||||
appPkg.SetChaosVersionLabel(compose, stackName, chaosVersion)
|
||||
appPkg.SetUpdateLabel(compose, stackName, app.Env)
|
||||
|
||||
envVars, err := appPkg.CheckEnv(app)
|
||||
@ -198,7 +199,7 @@ recipes.
|
||||
}
|
||||
}
|
||||
|
||||
if err := internal.DeployOverview(app, version, "continue with deployment?"); err != nil {
|
||||
if err := internal.DeployOverview(app, version, chaosVersion, "continue with deployment?"); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user