[collect/RHCOS] Fix sos collect on RHCOS nodes with SSH transport - #4393
[collect/RHCOS] Fix sos collect on RHCOS nodes with SSH transport#4393dwolstroRH wants to merge 2 commits into
Conversation
|
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
|
What is the typical Also, I feel the one commit aims to beat multiple flies, it is worth splitting it into more, for the sake of clarity (this makes sense to do once we agree on the first point). |
25816de to
1f12138
Compare
1f12138 to
15c3b1b
Compare
This should be fixed by #4397 so no need to extract |
15c3b1b to
de2feeb
Compare
de2feeb to
7aad9fe
Compare
The cleanup() method unconditionally attempted to delete the temporary namespace, but setup() only creates it when using the 'oc' transport. With SSH (control_persist) transport, the delete command would fail with a spurious error. Guard the deletion with a set_transport_type() check so cleanup matches setup's behavior. Related: SUPDEV-226 Signed-off-by: David Wolstromer <dwolstro@redhat.com>
7aad9fe to
bc6bc09
Compare
Sleep infinity keeps the container process alive so we can exec into it for sos report collection. This makes the -i The DCO should hopefully be fixed as well |
| _image = ( | ||
| '$(if [ -f /root/.toolboxrc ]; then ' | ||
| '. /root/.toolboxrc && echo "${REGISTRY}/${IMAGE}"; ' | ||
| 'else ' | ||
| f'echo "registry.redhat.io/rhel{self._rhel_version}/' | ||
| f'support-tools:latest"; ' | ||
| 'fi)' | ||
| ) |
There was a problem hiding this comment.
Absolutely not, no embedded bash scripting in sos.
bc6bc09 to
7b1ba22
Compare
Add _get_rhel_version() to detect the underlying RHEL major version from RHEL_VERSION in os-release (with PLATFORM_ID fallback), and use it to select the correct support-tools image (rhel8 vs rhel9). Also add .toolboxrc support to honor custom container registries, honor the force_pull option, and use 'sleep infinity' to keep the container running for exec. Related: SUPDEV-226 Signed-off-by: David Wolstromer <dwolstro@redhat.com>
7b1ba22 to
9f0a517
Compare
sos was not detected because RHELPolicy matched RHCOS nodes before RedHatCoreOSPolicy could be checked (both have ID=rhel in os-release)
Spurious namespace deletion error occurred with SSH transport because cleanup() tried to delete a namespace that was never created (namespaces are only created for 'oc' transport)
Fixes:
Related: SUPDEV-226
Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines