-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Allow namespace path network option for pods. #16386
Allow namespace path network option for pods. #16386
Conversation
Thanks @bjorndown |
c3ce299
to
7267475
Compare
|
||
It("podman pod create with namespace path networking", func() { | ||
SkipIfRootless("ip netns is not supported for rootless users") | ||
SkipIfContainerized("ip netns cannot be run within a container.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is correct
@@ -195,6 +195,9 @@ func MapSpec(p *specgen.PodSpecGenerator) (*specgen.SpecGenerator, error) { | |||
p.InfraContainerSpec.NetworkOptions = p.NetworkOptions | |||
p.InfraContainerSpec.NetNS.NSMode = specgen.Slirp | |||
} | |||
case specgen.Path: | |||
logrus.Debugf("Pod will use namespace path networking") | |||
p.InfraContainerSpec.NetNS.NSMode = specgen.Path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you also need to populate p.InfraContainerSpec.NetNS.Value
as well, which holds the path of the namespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean copy it from the pod spec:
p.InfraContainerSpec.NetNS.Value = p.PodNetworkConfig.NetNS.Value
MapSpec()
does not have a test yet, do you think I should add one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RE Copying - yes.
RE Test - I don't think it's strictly necessary, but I would definitely not complain if you added one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NetNS.Value
is set and I added a test for MapSpec()
.
7267475
to
32c30fc
Compare
Two tasks ran into a timeout:
I will trigger another run. |
Closes containers#16208. Signed-off-by: Björn Mosler <[email protected]>
32c30fc
to
049a5d8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bjorndown, Luap99, 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 |
/lgtm |
Closes #16208.
Signed-off-by: Björn Mosler [email protected]
Does this PR introduce a user-facing change?