Skip to content

Commit 37b8da4

Browse files
committed
pkg/cli/admin/upgrade/recommend: "accepted ... via ConditionalUpdateRisk"
Make it clearer how '--accept ConditionalUpdateRisk' maps to a risk like NonZonalAzureMachineSetScaling getting accepted, by turning the previous: Reason: accepted NonZonalAzureMachineSetScaling into: Reason: accepted NonZonalAzureMachineSetScaling via ConditionalUpdateRisk Eventually we'll have an API that allows us to use the conditional-update risk name itself (e.g. '--accept NonZonalAzureMachineSetScaling') [1,2], but this 'via...' context will hopefully help avoid confusion in the meantime. [1]: openshift/enhancements#1807 [2]: https://issues.redhat.com/browse/OTA-1543
1 parent f9d98d6 commit 37b8da4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/cli/admin/upgrade/recommend/recommend.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,11 @@ func (o *options) Run(ctx context.Context) error {
333333
}
334334
} else {
335335
if !o.quiet {
336-
acceptContext := ""
336+
reason := c.Reason
337337
if accept.Has("ConditionalUpdateRisk") {
338-
acceptContext = "accepted "
338+
reason = "accepted %s via ConditionalUpdateRisk"
339339
}
340-
fmt.Fprintf(o.Out, "Update to %s %s=%s:\nImage: %s\nRelease URL: %s\nReason: %s%s\nMessage: %s\n", update.Release.Version, c.Type, c.Status, update.Release.Image, update.Release.URL, acceptContext, c.Reason, strings.ReplaceAll(c.Message, "\n", "\n "))
340+
fmt.Fprintf(o.Out, "Update to %s %s=%s:\nImage: %s\nRelease URL: %s\nReason: %s\nMessage: %s\n", update.Release.Version, c.Type, c.Status, update.Release.Image, update.Release.URL, reason, strings.ReplaceAll(c.Message, "\n", "\n "))
341341
}
342342
issues.Insert("ConditionalUpdateRisk")
343343
}

0 commit comments

Comments
 (0)