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

This commit is contained in:
2023-02-01 19:43:25 +01:00
parent 98db4095a3
commit dd2af251f9

View File

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