Skip to content

Commit 4e93466

Browse files
committed
pkg/cli/admin/upgrade/recommend: Add a blank line after --version conditional risk
When I added the: Update to 4.18.6 Recommended=False: ... block in c1ef328 (pkg/cli/admin/upgrade/recommend: Add --version option for specific releases, 2024-10-14, #1897), there was no subsequent output in this "--version has conditional risks" case, so the earlier lack-of-blank-line made sense. But then 2d7e004 (pkg/cli/admin/upgrade/recommend: New, feature-gated --accept, 2025-05-06, #2023) gave the option for a subsequent: error: issues that apply to this cluster but which were not included in --accept: ... or: Update to %s has no known issues relevant... This commit adds a new line to standard output, to offset those summaries from the possibly-long Message: ... Update to 4.18.6 Recommended=False: Image: quay.io/openshift-release-dev/ocp-release@sha256:61fdad894f035a8b192647c224faf565279518255bdbf60a91db4ee0479adaa6 Release URL: https://access.redhat.com/errata/RHSA-2025:3066 Reason: CRIOLayerCompressionPulls Message: The CRI-O container runtime may fail to pull images with certain layer compression characteristics https://issues.redhat.com/browse/OCPNODE-3074 error: issues that apply to this cluster but which were not included in --accept: ConditionalUpdateRisk,KubeContainerWaiting instead of cramming that 'error: ...' or '... has no known issues...' right onto the end of the output. Although the error is getting written to standard error instead of the standard output, so in that case, the newline will only matter for terminal users and others who are flattening those two streams together.
1 parent 9b2ae28 commit 4e93466

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,12 @@ func (o *options) Run(ctx context.Context) error {
343343
}
344344
unaccepted := issues.Difference(accept)
345345
if unaccepted.Len() > 0 {
346+
if !o.quiet {
347+
fmt.Println(o.Out)
348+
}
346349
return fmt.Errorf("issues that apply to this cluster but which were not included in --accept: %s", strings.Join(sets.List(unaccepted), ","))
347350
} else if issues.Len() > 0 && !o.quiet {
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), ","))
351+
fmt.Fprintf(o.Out, "\nUpdate to %s has no known issues relevant to this cluster other than the accepted %s.\n", update.Release.Version, strings.Join(sets.List(issues), ","))
349352
}
350353
return nil
351354
}

0 commit comments

Comments
 (0)