-
Notifications
You must be signed in to change notification settings - Fork 473
OCPBUGS-60768: properly indent multiline node messages in upgrade status output #2341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -557,7 +557,14 @@ func (pool *poolDisplayData) WriteNodes(w io.Writer, detailed bool) { | |
| _, _ = tabw.Write([]byte(node.Phase.String() + "\t")) | ||
| _, _ = tabw.Write([]byte(version + "\t")) | ||
| _, _ = tabw.Write([]byte(node.Estimate + "\t")) | ||
| _, _ = tabw.Write([]byte(node.Message + "\n")) | ||
| 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")) | ||
| } | ||
| } | ||
|
Comment on lines
+560
to
+567
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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/statusRepository: 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.goRepository: openshift/oc Length of output: 5320 Return
🤖 Prompt for AI AgentsSource: Path instructions |
||
| } | ||
| tabw.Flush() | ||
| if total > 0 { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sure trailing newline is handled properly and not added in a duplicating way.