Skip to content

Commit

Permalink
fix: allow updating values quickly with --set flag
Browse files Browse the repository at this point in the history
  • Loading branch information
majori committed Oct 3, 2024
1 parent 5260a1b commit 1875031
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/cli/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ func runUpgrade(cmd *cobra.Command, opts upgradeOptions) error {
}

} else {
opts.ReuseOldValues = false
cmd.Printf(
"Modifying values for sauce with recipe '%s' version %s\n",
oldSauce.Recipe.Name,
Expand Down Expand Up @@ -210,6 +209,12 @@ func runUpgrade(cmd *cobra.Command, opts upgradeOptions) error {

values = recipeutil.MergeValues(reusedValues, providedValues)

// If the user is updating values for a recipe and hasn't provided any values,
// assume that all values needs to be prompted
if versionComparison == 0 && len(providedValues) == 0 {
opts.ReuseOldValues = false
}

if opts.ReuseOldValues {
validatedValues, errs := recipeutil.CleanValues(re.Variables, oldSauce.Values)
if len(errs) != 0 {
Expand Down

0 comments on commit 1875031

Please sign in to comment.