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:
parent
2dcbfa1d65
commit
62f8103fc2
|
@ -240,15 +240,21 @@ You may invoke this command in "wizard" mode and be prompted for input:
|
|||
compatibleStrings = append(compatibleStrings, regVersion)
|
||||
}
|
||||
}
|
||||
|
||||
prompt := &survey.Select{
|
||||
Message: msg,
|
||||
Help: "enter / return to confirm, choose 'skip' to not upgrade this tag, vim mode is enabled",
|
||||
VimMode: true,
|
||||
Options: compatibleStrings,
|
||||
}
|
||||
if err := survey.AskOne(prompt, &upgradeTag); err != nil {
|
||||
logrus.Fatal(err)
|
||||
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",
|
||||
VimMode: true,
|
||||
Options: compatibleStrings,
|
||||
}
|
||||
if err := survey.AskOne(prompt, &upgradeTag); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue