Skip to content
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

Automated cherry pick of #5364: Stop using /bin/sh for OVS commands #5373

Conversation

antoninbas
Copy link
Contributor

Cherry pick of #5364 on release-1.12.

#5364: Stop using /bin/sh for OVS commands

For details on the cherry pick process, see the cherry pick requests page.

We are currently using the shell (/bin/sh) to run ovs-appctl and
ovs-ofctl commands, but there does not seem to be a reason to do so.

Instead, we can invoke the binary directly with exec.Command and pass
the arguments as a slice.

Before this change, ovsVSwitchdUDS would return
"/var/run/openvswitch/ovs-vswitchd.*.ctl" as a fallback value in case
the PID of ovs-vswitchd could not be determined. The shell would then
expand the wildcard patterns. I now believe that it is better to return
an error in that case. We want to make sure that we use a valid file
always (and returning the glob pattern would cause an error if multiple
files match). If we run into issues because of this approach, we can
update the code to expand the glob pattern programmatically and, if a
single path matches, we can return that path.

Signed-off-by: Antonin Bas <abas@vmware.com>
Signed-off-by: Antonin Bas <abas@vmware.com>
@antoninbas antoninbas added the kind/cherry-pick Categorizes issue or PR as related to the cherry-pick of a bug fix from the main branch to a release label Aug 9, 2023
@antoninbas antoninbas requested a review from tnqn August 9, 2023 04:51
@antoninbas
Copy link
Contributor Author

/skip-all

@antoninbas antoninbas added the action/release-note Indicates a PR that should be included in release notes. label Aug 9, 2023
@antoninbas antoninbas merged commit 56ad993 into antrea-io:release-1.12 Aug 9, 2023
@antoninbas antoninbas deleted the automated-cherry-pick-of-#5364-upstream-release-1.12 branch August 9, 2023 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/release-note Indicates a PR that should be included in release notes. kind/cherry-pick Categorizes issue or PR as related to the cherry-pick of a bug fix from the main branch to a release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants