fix: set updatelabel on upgrade, select latest instead of next release

This commit is contained in:
Moritz 2023-02-01 19:43:25 +01:00
parent 193091f4d0
commit 24e751032a
1 changed files with 4 additions and 1 deletions

View File

@ -202,7 +202,8 @@ func getLatestUpgrade(cl *dockerclient.Client, stackName string, recipeName stri
logrus.Debugf("no available upgrades for %s", stackName)
return ""
}
availableUpgrades = internal.ReverseStringList(availableUpgrades)
// Uncomment to select the next version instead of the last version
// availableUpgrades = internal.ReverseStringList(availableUpgrades)
var chosenUpgrade string
if len(availableUpgrades) > 0 {
chosenUpgrade = availableUpgrades[len(availableUpgrades)-1]
@ -262,6 +263,7 @@ func getAvailableUpgrades(cl *dockerclient.Client, stackName string, recipeName
availableUpgrades = append(availableUpgrades, version)
}
}
logrus.Debugf("Available updates for %s: %s", stackName, availableUpgrades)
return availableUpgrades
@ -320,6 +322,7 @@ func createDeployConfig(recipeName string, stackName string, env config.AppEnv)
// after the upgrade the deployment won't be in chaos state anymore
config.SetChaosLabel(compose, stackName, false)
config.SetRecipeLabel(compose, stackName, recipeName)
config.SetUpdateLabel(compose, stackName, env)
return compose, deployOpts
}