Skip to content

[openshift_ovn] Allow specific container runtime for plugin command#4076

Merged
TurboTurtle merged 1 commit into
sosreport:mainfrom
dwolstroRH:openshift_ovn_run_issues
Jul 31, 2025
Merged

[openshift_ovn] Allow specific container runtime for plugin command#4076
TurboTurtle merged 1 commit into
sosreport:mainfrom
dwolstroRH:openshift_ovn_run_issues

Conversation

@dwolstroRH

Copy link
Copy Markdown
Contributor

This Update allows a specific container runtime to be passed to add_cmd_output so commands that must use a specific runtime do so.

Related: SUPDEV-180


Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines

  • Is the commit message split over multiple lines and hard-wrapped at 72 characters?
  • Is the subject and message clear and concise?
  • Does the subject start with [plugin_name] if submitting a plugin patch or a [section_name] if part of the core sosreport code?
  • Does the commit contain a Signed-off-by: First Lastname email@example.com?
  • Are any related Issues or existing PRs properly referenced via a Closes (Issue) or Resolved (PR) line?
  • Are all passwords or private data gathered by this PR obfuscated?

@packit-as-a-service

Copy link
Copy Markdown

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/sosreport-sos-4076
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

TurboTurtle
TurboTurtle previously approved these changes Jul 9, 2025
Comment on lines -53 to +59
container='ovnkube-master')
self.add_cmd_output([
'ovs-appctl -t /var/run/ovn/ovn-controller.*.ctl ' +
'ct-zone-list'],
container='ovnkube-node')
self.add_cmd_output([
'ovs-appctl -t /var/run/ovn/ovn-controller.*.ctl ' +
'ct-zone-list'],
container='ovnkube-controller')
container='ovnkube-master',
runtime='crio')
# We need to determine the actual file name to send
# to the command
files = glob.glob("/var/run/ovn/ovn-controller.*.ctl")
for file in files:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this collection not behave correctly when directly specifying the glob? Is that why we're also changing this to a per-file iteration?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

When this command was getting executed, the filename '/var/run/ovn/ovn-controller..ctl' parameter within the command string was not getting expanded. The '' represents the current process id of the container, ie, '/var/run/ovn/ovn-controller.3127.ctl', which lead to a "File Not Found Error" condition when executing the command. I changed to find the filename before passing the command string into add_cmd_output.

Comment on lines +60 to +67
self.add_cmd_output([
'ovs-appctl -t ' + file +
' ct-zone-list'],
container='ovnkube-node',
runtime='crio')
self.add_cmd_output([
'ovs-appctl -t ' + file +
' ct-zone-list'],
container='ovnkube-controller',
runtime='crio')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

a_c_o() takes a list or a string. With this change now doing single files at a time the list is superfluous.

Also, please convert these to f-strings. A while back we made an effort to convert everything we could to f-strings, but I guess we overlooked this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These are separate calls because they target different containers and the container parameter is not part of the list. These calls previously existed, I simply updated them to pass the file name correctly. I will update the 3 calls that I changed to use f-strings.

@TurboTurtle TurboTurtle added Kind/Enhancement Kind/RedHat RedHat related item Kind/Collection New or updated command or file collection labels Jul 10, 2025
@TurboTurtle TurboTurtle dismissed their stale review July 10, 2025 03:05

Accidentally hit approve on this instead of comment.

@dwolstroRH dwolstroRH force-pushed the openshift_ovn_run_issues branch from 97a1a71 to f512efd Compare July 14, 2025 19:03
@pmoravec pmoravec added the Reviewed/Needs 2nd Ack Require a 2nd ack from a maintainer label Jul 18, 2025

@TurboTurtle TurboTurtle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. If you could please rebase to current main, we'll get this merged.

@TurboTurtle TurboTurtle added Reviewed/Needs Rebase Code has been reviewed and can be merged once branch is rebased to current main. and removed Reviewed/Needs 2nd Ack Require a 2nd ack from a maintainer labels Jul 25, 2025
@dwolstroRH dwolstroRH force-pushed the openshift_ovn_run_issues branch from f512efd to deed2a6 Compare July 28, 2025 17:31
This Update allows a specific container runtime to be passed to
add_cmd_output so commands that must use a specific runtime do so.

Related: SUPDEV-180

Signed-off-by: David Wolstromer <dwolstro@redhat.com>
@dwolstroRH dwolstroRH force-pushed the openshift_ovn_run_issues branch from deed2a6 to b583702 Compare July 28, 2025 18:38
@TurboTurtle TurboTurtle merged commit b61937c into sosreport:main Jul 31, 2025
37 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Kind/Collection New or updated command or file collection Kind/Enhancement Kind/RedHat RedHat related item Reviewed/Needs Rebase Code has been reviewed and can be merged once branch is rebased to current main.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants