recipe/upgrade: Add non-interactive mode.

Add support for -n which just outputs the list of compatible tags for each image.
This commit is contained in:
Cassowary 2023-04-12 14:58:21 -07:00 committed by Gitea
parent 2dcbfa1d65
commit 62f8103fc2
1 changed files with 15 additions and 9 deletions

View File

@ -240,7 +240,12 @@ You may invoke this command in "wizard" mode and be prompted for input:
compatibleStrings = append(compatibleStrings, regVersion)
}
}
if internal.NoInput {
logrus.Infof("potential upgrades for service: %s, image: %s, tag: %s ::\t", service.Name, image, tag)
for _, upgradableVersion := range compatibleStrings[1:] {
logrus.Infof("\t%s\n", upgradableVersion)
}
} else {
prompt := &survey.Select{
Message: msg,
Help: "enter / return to confirm, choose 'skip' to not upgrade this tag, vim mode is enabled",
@ -252,6 +257,7 @@ You may invoke this command in "wizard" mode and be prompted for input:
}
}
}
}
if upgradeTag != "skip" {
ok, err := recipe.UpdateTag(image, upgradeTag)
if err != nil {