forked from toolshed/abra
		
	feat: support skipping upgrades
This commit is contained in:
		@ -38,6 +38,10 @@ Some image tags cannot be parsed because they do not follow some sort of
 | 
			
		||||
semver-like convention. In this case, all possible tags will be listed and it
 | 
			
		||||
is up to the end-user to decide.
 | 
			
		||||
 | 
			
		||||
The command is interactive and will show a select input which allows you to
 | 
			
		||||
make a seclection. Use the "?" key to see more help on navigating this
 | 
			
		||||
interface.
 | 
			
		||||
 | 
			
		||||
You may invoke this command in "wizard" mode and be prompted for input:
 | 
			
		||||
 | 
			
		||||
    abra recipe upgrade
 | 
			
		||||
@ -154,7 +158,7 @@ You may invoke this command in "wizard" mode and be prompted for input:
 | 
			
		||||
				logrus.Fatal(err)
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			var compatibleStrings []string
 | 
			
		||||
			compatibleStrings := []string{"skip"}
 | 
			
		||||
			for _, compat := range compatible {
 | 
			
		||||
				skip := false
 | 
			
		||||
				for _, catlVersion := range catlVersions {
 | 
			
		||||
@ -224,6 +228,8 @@ You may invoke this command in "wizard" mode and be prompted for input:
 | 
			
		||||
 | 
			
		||||
					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 {
 | 
			
		||||
@ -231,10 +237,14 @@ You may invoke this command in "wizard" mode and be prompted for input:
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			if err := recipe.UpdateTag(image, upgradeTag); err != nil {
 | 
			
		||||
				logrus.Fatal(err)
 | 
			
		||||
			if upgradeTag != "skip" {
 | 
			
		||||
				if err := recipe.UpdateTag(image, upgradeTag); err != nil {
 | 
			
		||||
					logrus.Fatal(err)
 | 
			
		||||
				}
 | 
			
		||||
				logrus.Infof("tag upgraded from %s to %s for %s", tag.String(), upgradeTag, image)
 | 
			
		||||
			} else {
 | 
			
		||||
				logrus.Warnf("not upgrading %s, skipping as requested", image)
 | 
			
		||||
			}
 | 
			
		||||
			logrus.Infof("tag upgraded from %s to %s for %s", tag.String(), upgradeTag, image)
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		return nil
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user