-
Bug
-
Resolution: Unresolved
-
Undefined
-
None
-
4.19
-
None
-
Quality / Stability / Reliability
-
False
-
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Description of problem:
The volume usage checker script in must-gather outputs critical error messages
to stdout instead of stderr. When disk space exceeds the configured limit, the
error message "Disk usage exceeds the volume percentage..." is written to stdout
(line 98 in pkg/cli/admin/mustgather/mustgather.go), which is inconsistent with
Unix conventions and the error handling pattern used elsewhere in the must-gather
codebase.
Version-Release number of selected component (if applicable):
How reproducible:
Always - the volumeUsageCheckerScript uses plain 'echo' commands which always
write to stdout.
Steps to Reproduce:
1. Run `oc adm must-gather` with output redirection: `oc adm must-gather > output.log`
2. Trigger disk usage to exceed the --volume-percentage limit (default 70%)
3. Observe that the critical error "Disk usage exceeds the volume percentage..."
is written to output.log instead of appearing on the terminal
Actual results:
The disk usage error message goes to stdout and gets captured by output
redirection, potentially making the error invisible to the user if they're
redirecting stdout to a file.
Expected results:
The disk usage error message should be written to stderr (using '>&2'
redirection) so it:
- Remains visible on the terminal even when stdout is redirected
- Follows Unix conventions where errors go to stderr
- Matches the pattern used elsewhere in must-gather (e.g., lines 1252-1267
use fmt.Fprintf(o.ErrOut, ...) for errors)
Additional info: