Skip to content

OCPBUGS-60768: properly indent multiline node messages in upgrade status output - #2341

Open
savio87 wants to merge 1 commit into
openshift:mainfrom
savio87:OCPBUGS-60768
Open

OCPBUGS-60768: properly indent multiline node messages in upgrade status output#2341
savio87 wants to merge 1 commit into
openshift:mainfrom
savio87:OCPBUGS-60768

Conversation

@savio87

@savio87 savio87 commented Aug 4, 2026

Copy link
Copy Markdown

Summary

When node status messages contain newlines (e.g., verbose podman pull errors), the continuation lines break out of the MESSAGE column and misalign subsequent rows in oc adm upgrade status output.

This applies the same multiline handling pattern already used for cluster operator messages in controlplane.go — splitting on newlines and indenting continuation lines with tabs to align under the MESSAGE column.

Bug: https://redhat.atlassian.net/browse/OCPBUGS-60768

Changes

  • workerpool.go: Split node.Message on \n and indent continuation lines with tabs in WriteNodes()
  • Updated golden fixture files to reflect the corrected output

Summary by CodeRabbit

  • New Features
    • Upgrade status output now displays multi-line node messages across properly aligned table rows.
    • Control-plane upgrade details include retry attempts, final image-pull errors, and command exit statuses.
    • Node statuses and columns are presented with improved alignment for clearer readability.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 4, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@savio87: This pull request references Jira Issue OCPBUGS-60768, which is invalid:

  • expected the bug to target the "5.0.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Summary

When node status messages contain newlines (e.g., verbose podman pull errors), the continuation lines break out of the MESSAGE column and misalign subsequent rows in oc adm upgrade status output.

This applies the same multiline handling pattern already used for cluster operator messages in controlplane.go — splitting on newlines and indenting continuation lines with tabs to align under the MESSAGE column.

Bug: https://redhat.atlassian.net/browse/OCPBUGS-60768

Changes

  • workerpool.go: Split node.Message on \n and indent continuation lines with tabs in WriteNodes()
  • Updated golden fixture files to reflect the corrected output

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Walkthrough

WriteNodes now renders multi-line node messages across table rows. Upgrade status examples include the third image-pull retry, final pull errors, exit status, and updated node statuses.

Changes

Upgrade status output

Layer / File(s) Summary
Multi-line node output and example updates
pkg/cli/admin/upgrade/status/workerpool.go, pkg/cli/admin/upgrade/status/examples/ocpbugs-60768.*
WriteNodes splits multi-line messages and indents continuation lines. Example outputs include the third pull retry, final errors, exit status 125, and updated node statuses.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: needs-ok-to-test

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the multiline node message indentation change in upgrade status output.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The commit changes only workerpool.go and two golden fixtures; it adds or modifies no test files or Ginkgo test titles.
Test Structure And Quality ✅ Passed PR changes only workerpool.go and golden fixtures; no Ginkgo test files or Ginkgo constructs are added or modified, and nearby tests use standard Go testing.
Microshift Test Compatibility ✅ Passed The PR changes only WriteNodes formatting and golden fixtures; no new Ginkgo e2e tests or MicroShift-incompatible test APIs are present.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No Ginkgo e2e tests were added; the commit changes only workerpool.go and golden output fixtures, so SNO compatibility checks are not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed The change only formats multiline node messages and updates golden output fixtures; it adds no manifests, controllers, replicas, affinity, topology spread, selectors, tolerations, or PDBs.
Ote Binary Stdout Contract ✅ Passed The PR changes only status rendering and fixtures; no OTE entry-point code changed, and WriteNodes writes to its supplied io.Writer rather than directly to stdout.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The commit changes only workerpool.go and two static output fixtures; it adds no Ginkgo e2e tests, IP parsing, network calls, or external connectivity requirements.
No-Weak-Crypto ✅ Passed The PR only splits node messages and writes tab-indented lines in WriteNodes; added code imports no crypto package and uses no MD5, SHA1, DES, RC4, Blowfish, ECB, or secret comparison.
Container-Privileges ✅ Passed The PR changes only workerpool.go and output fixtures; no changed file adds a container manifest or privilege settings such as privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, or allowPrivileg...
No-Sensitive-Data-In-Logs ✅ Passed The patch only reformats existing node.Message output; fixture non-whitespace content is unchanged, and added code contains no credential, PII, or new logging sink.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@openshift-ci
openshift-ci Bot requested review from ardaguclu and atiratree August 4, 2026 09:28
@openshift-ci

openshift-ci Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: savio87
Once this PR has been reviewed and has the lgtm label, please assign davidhurta for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 4, 2026
@openshift-ci

openshift-ci Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Hi @savio87. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@savio87

savio87 commented Aug 4, 2026

Copy link
Copy Markdown
Author

Applies the same multiline indentation pattern already used for cluster operator messages in controlplane.go. Could a maintainer update the target version on OCPBUGS-60768 and run /ok-to-test? Thanks!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/cli/admin/upgrade/status/workerpool.go`:
- Around line 560-567: Update WriteNodes to return an error and check/propagate
failures from fmt.Fprintf, tabwriter.Write, and tabwriter.Flush, including
errors while writing node messages. Update both WriteNodes call sites in
status.go to handle and return the propagated error through the command path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 6da72201-20f4-4c08-bcbd-9909f666a48b

📥 Commits

Reviewing files that changed from the base of the PR and between 9c7ccc4 and f21868a.

📒 Files selected for processing (3)
  • pkg/cli/admin/upgrade/status/examples/ocpbugs-60768.detailed-output
  • pkg/cli/admin/upgrade/status/examples/ocpbugs-60768.output
  • pkg/cli/admin/upgrade/status/workerpool.go

Comment on lines +560 to +567
lines := strings.Split(node.Message, "\n")
for i, line := range lines {
if i == 0 {
_, _ = tabw.Write([]byte(line + "\n"))
} else {
_, _ = tabw.Write([]byte("\t\t\t\t\t" + line + "\n"))
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n -C 3 '\bWriteNodes\s*\(' pkg/cli/admin/upgrade/status

Repository: openshift/oc

Length of output: 1828


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== workerpool WriteNodes area =="
sed -n '488,572p' pkg/cli/admin/upgrade/status/workerpool.go

echo
echo "== status WriteNodes call sites area =="
sed -n '346,372p' pkg/cli/admin/upgrade/status/status.go

echo
echo "== poolDisplayData WriteNodes definition/uses in workerpool =="
rg -n -C 2 'func \(pool \*poolDisplayData\) WriteNodes|WriteNodes\s*\(' pkg/cli/admin/upgrade/status/workerpool.go pkg/cli/admin/upgrade/status/status.go

Repository: openshift/oc

Length of output: 5320


Return WriteNodes output errors to callers.

WriteNodes ignores errors from fmt.Fprintf, tabwriter.Write, and tabwriter.Flush, so an io.Writer failure can leave the status output incomplete and be hidden at the two call sites in pkg/cli/admin/upgrade/status/status.go. Make WriteNodes return an error and propagate the failure up the command path.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/cli/admin/upgrade/status/workerpool.go` around lines 560 - 567, Update
WriteNodes to return an error and check/propagate failures from fmt.Fprintf,
tabwriter.Write, and tabwriter.Flush, including errors while writing node
messages. Update both WriteNodes call sites in status.go to handle and return
the propagated error through the command path.

Source: Path instructions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants