You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pkg/cli/admin/upgrade/recommend: Add a --quiet option
As part of the --affirm feature, because listing unaccepted issues
names gives us a way to say "we have more problems we think you should
consider" for folks who just want a short summary before deciding
whether they want more details. I'm keeping the chatty version as the
default, because historically we have had users who don't want to look
at the details, and instead hope that waiting will be enough for the
issues to resolve.
For "there was a regression, and Red Hat will ship a fix", waiting
will eventually work. But for "your cluster is alerting, and you
should look into that", waiting is unlikely to help. And even for the
regression situation, it is the user's responsibility to weigh the
risk of updating into the known regression against the risk of
remaining on an old, possibly buggy release. Red Hat will support
either choice [1].
Having --quiet be an explicit choice makes it clear that Red Hat
thinks the user should be engaging with and evaluating any detected
issues, while allowing users to say "I don't have time now, sorry.
Give me the short summary".
[1]: https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/updating_clusters/understanding-openshift-updates-1#conditional-updates-overview_understanding-update-channels-releases
flags.BoolVar(&o.quiet, "quiet", o.quiet, "When --quiet is true and --version is set, only print unaccepted issue names.")
66
67
flags.StringSliceVar(&o.accept, "accept", o.accept, "Comma-delimited names for issues that you find acceptable. With --version, any unaccepted issues will result in a non-zero exit code.")
67
68
}
68
69
@@ -80,6 +81,9 @@ type options struct {
80
81
showOutdatedReleasesbool
81
82
precheckEnabledbool
82
83
84
+
// quiet configures the verbosity of output. When 'quiet' is true and 'version' is set, only print unaccepted issue names.
85
+
quietbool
86
+
83
87
// rawVersion is parsed into version by options.Complete. Do not consume it directly outside of that early option handling.
fmt.Fprintf(o.Out, "%sinfo: An update is in progress. You may wish to let this update complete before requesting a new update.\n %s\n\n", acceptContext, strings.ReplaceAll(c.Message, "\n", "\n "))
186
+
if!o.quiet {
187
+
fmt.Fprintf(o.Out, "%sinfo: An update is in progress. You may wish to let this update complete before requesting a new update.\n %s\n\n", acceptContext, strings.ReplaceAll(c.Message, "\n", "\n "))
fmt.Fprintf(o.Out, "The following conditions found no cause for concern in updating this cluster to later releases: %s\n\n", strings.Join(happyConditions, ", "))
202
-
}
203
-
iflen(acceptedConditions) >0 {
204
-
sort.Strings(acceptedConditions)
205
-
fmt.Fprintf(o.Out, "The following conditions found cause for concern in updating this cluster to later releases, but were explicitly accepted via --accept: %s\n\n", strings.Join(acceptedConditions, ", "))
206
-
}
207
-
iflen(unhappyConditions) >0 {
208
-
sort.Strings(unhappyConditions)
209
-
fmt.Fprintf(o.Out, "The following conditions found cause for concern in updating this cluster to later releases: %s\n\n", strings.Join(unhappyConditions, ", "))
fmt.Fprintf(o.Out, "The following conditions found no cause for concern in updating this cluster to later releases: %s\n\n", strings.Join(happyConditions, ", "))
220
+
}
221
+
iflen(acceptedConditions) >0 {
222
+
sort.Strings(acceptedConditions)
223
+
fmt.Fprintf(o.Out, "The following conditions found cause for concern in updating this cluster to later releases, but were explicitly accepted via --accept: %s\n\n", strings.Join(acceptedConditions, ", "))
224
+
}
225
+
iflen(unhappyConditions) >0 {
226
+
sort.Strings(unhappyConditions)
227
+
fmt.Fprintf(o.Out, "The following conditions found cause for concern in updating this cluster to later releases: %s\n\n", strings.Join(unhappyConditions, ", "))
fmt.Fprintf(o.Out, "Update to %s has no known issues relevant to this cluster.\nImage: %s\nRelease URL: %s\n", update.Release.Version, update.Release.Image, update.Release.URL)
331
+
if!o.quiet {
332
+
fmt.Fprintf(o.Out, "Update to %s has no known issues relevant to this cluster.\nImage: %s\nRelease URL: %s\n", update.Release.Version, update.Release.Image, update.Release.URL)
returnfmt.Errorf("issues that apply to this cluster but which were not included in --accept: %s", strings.Join(sets.List(unaccepted), ","))
311
-
} elseifissues.Len() >0 {
347
+
} elseifissues.Len() >0&&!o.quiet{
312
348
fmt.Fprintf(o.Out, "Update to %s has no known issues relevant to this cluster other than the accepted %s.\n", update.Release.Version, strings.Join(sets.List(issues), ","))
0 commit comments