fix: set "chaos" if a specified* version is "chaos-y"
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing

*either from env file or command-line
This commit is contained in:
3wc
2025-09-08 22:21:18 -04:00
parent 39d1997edf
commit d866527138

View File

@ -106,13 +106,15 @@ checkout as-is. Recipe commit hashes are also supported as values for
log.Fatal(i18n.G("get deploy version: %s", err))
}
versionIsChaos := false
if !internal.Chaos {
isChaos, err := app.Recipe.EnsureVersion(toDeployVersion)
var err error
versionIsChaos, err = app.Recipe.EnsureVersion(toDeployVersion)
if err != nil {
log.Fatal(i18n.G("ensure recipe: %s", err))
}
if isChaos {
log.Fatal(i18n.G("version '%s' appears to be a chaos commit, but --chaos/-C was not provided", toDeployVersion))
if versionIsChaos {
log.Warnf(i18n.G("version '%s' appears to be a chaos commit, but --chaos/-C was not provided", toDeployVersion))
}
}
@ -152,7 +154,7 @@ 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.SetChaosLabel(compose, stackName, internal.Chaos || versionIsChaos)
if internal.Chaos {
appPkg.SetChaosVersionLabel(compose, stackName, toDeployVersion)
}