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

podman: Added find slirp4netns binary file from helper_binaries_dir #18620

Conversation

HirazawaUi
Copy link
Contributor

@HirazawaUi HirazawaUi commented May 18, 2023

[NO NEW TESTS NEEDED]

Fixes: #18568

Does this PR introduce a user-facing change?

If --network-cmd-path is not set, then slirp4netns binary will first be searched using the `helper_binaries_dir` option in `containers.conf`, and second using the `$ PATH` environment variable.

@rhatdan
Copy link
Member

rhatdan commented May 18, 2023

You must sign your commits.
git commit -a --amend -s
git push --force

Also does this require any man page changes?

@Luap99 PTAL

@PhrozenByte
Copy link
Contributor

PhrozenByte commented May 18, 2023

Thanks @HirazawaUi 👍

Can you please also add deprecation notices to uses of r.config.Engine.NetworkCmdPath? Like the following (that should be updated, too):

// TODO (5.0): remove this option with the next major release after https://github.com/containers/podman/issues/18560 was implemented

Also does this require any man page changes?

Yes, that would be appreciated as per discussion in #18560. To be more precise: The docs should explain the fallback to helper_binaries_dir, and that --network-cmd-path is a deprecated option that will be removed with the next major release (whether Podman 5.0 really drops it is something to decide when Podman 5.0 is actually on its way)

#### **--network-cmd-path**=*path*
Path to the `slirp4netns(1)` command binary to use for setting up a slirp4netns network. If "" is used then the binary is looked up using the $PATH environment variable.

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

code change LGTM but I would like to see the documentation change as mentioned by @PhrozenByte

@TomSweeneyRedHat
Copy link
Member

Changes LGTM
But one of your commits appears to be unsigned and needs to be signed. Added doc is always good.

@HirazawaUi HirazawaUi force-pushed the find_slirp4netns_from_helper_binaries_dir branch 3 times, most recently from b7fb86e to 258e87c Compare May 19, 2023 18:00
@HirazawaUi
Copy link
Contributor Author

Thanks for the reminder, I have finished the signature and modified the docs

@HirazawaUi
Copy link
Contributor Author

Can you please also add deprecation notices to uses of r.config.Engine.NetworkCmdPath? Like the following (that should be updated, too):

There are so many places to use r.config.Engine.NetworkCmdPath that it seems too tedious to add deprecation notices to each one, so I chose to add a section after the TODO in cmd/podman/root.go that tells us we need to clean up each one one after we finish Code that uses r.config.Engine.NetworkCmdPath, do you like it this way?

Copy link
Contributor

@PhrozenByte PhrozenByte left a comment

Choose a reason for hiding this comment

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

Thanks @HirazawaUi

Just some docs stuff. LGTM besides those small things 👍

Note: I can't say anything about the actual code changes 😉

@@ -83,7 +83,8 @@ Remote connections use local containers.conf for default.
Log messages at and above specified level: debug, info, warn, error, fatal or panic (default: "warn")

#### **--network-cmd-path**=*path*
Path to the `slirp4netns(1)` command binary to use for setting up a slirp4netns network. If "" is used then the binary is looked up using the $PATH environment variable.
Path to the `slirp4netns(1)` command binary to use for setting up a slirp4netns network. If "" is used, then the binary will be searched for from the helper_binaries_dir.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Path to the `slirp4netns(1)` command binary to use for setting up a slirp4netns network. If "" is used, then the binary will be searched for from the helper_binaries_dir.
Path to the `slirp4netns(1)` command binary to use for setting up a slirp4netns network. If "" is used, then the binary will first be searched using the `helper_binaries_dir` option in `containers.conf`, and second using the `$PATH` environment variable.

Explain what helper_binaries_dir is and still mention $PATH.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good suggestion

@@ -83,7 +83,8 @@ Remote connections use local containers.conf for default.
Log messages at and above specified level: debug, info, warn, error, fatal or panic (default: "warn")

#### **--network-cmd-path**=*path*
Path to the `slirp4netns(1)` command binary to use for setting up a slirp4netns network. If "" is used then the binary is looked up using the $PATH environment variable.
Path to the `slirp4netns(1)` command binary to use for setting up a slirp4netns network. If "" is used, then the binary will be searched for from the helper_binaries_dir.
It will be deprecated in Podman 5.0.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
It will be deprecated in Podman 5.0.
**Note:** This option is deprecated and will be removed with Podman 5.0. Use the `helper_binaries_dir` option in `containers.conf` instead.

The option is deprecated as of now (resp. the next version this happens to get merged into); it might be removed with Podman 5.0.

Copy link
Contributor

Choose a reason for hiding this comment

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

Just thinking about it: Doesn't this imply a user facing change?

Cc: @Luap99

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good suggestion, this is supposed to be a user facing change, I will add it later

@@ -439,6 +439,7 @@ func rootFlags(cmd *cobra.Command, podmanConfig *entities.PodmanConfig) {
_ = cmd.RegisterFlagCompletionFunc(conmonFlagName, completion.AutocompleteDefault)

// TODO (5.0): remove this option with the next major release after https://github.com/containers/podman/issues/18560 was implemented
Copy link
Contributor

@PhrozenByte PhrozenByte May 19, 2023

Choose a reason for hiding this comment

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

Suggested change
// TODO (5.0): remove this option with the next major release after https://github.com/containers/podman/issues/18560 was implemented
// TODO (5.0): --network-cmd-path is deprecated, consider removing it

There's no need to still reference the issue. You can also merge this with the next line if you want to.

I agree that adding notices to every use is a bit tedious...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree not to reference this issue, but I think --network-cmd-path is deprecated, remove this option with the next major release would be better.

@HirazawaUi HirazawaUi force-pushed the find_slirp4netns_from_helper_binaries_dir branch from 258e87c to 2974936 Compare May 19, 2023 19:17
@PhrozenByte
Copy link
Contributor

LGTM, thanks @HirazawaUi for your work and considering the suggestions! 👍

@rhatdan
Copy link
Member

rhatdan commented May 19, 2023

/aprove
/lgtm
Thanks @HirazawaUi

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 19, 2023
@rhatdan
Copy link
Member

rhatdan commented May 20, 2023

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 20, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: HirazawaUi, rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 20, 2023
@openshift-merge-robot openshift-merge-robot merged commit a829122 into containers:main May 20, 2023
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Aug 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

slirp4netns should honour the helper_binaries_dir config
6 participants