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

libnetwork: add option to return rootless-netns ips #1998

Merged
merged 1 commit into from
May 16, 2024

Conversation

Luap99
Copy link
Member

@Luap99 Luap99 commented May 16, 2024

When using the bridge network mode as rootless we use the rootless netns logic, for podman this looks like just as using bridge as root. The issue is however due the extra namespace we block certain address there. This can be seen best with pasta but actually effects other cases too. The podman logic tries to use any host ip address for host.containers.internal but we must make sure to exculde all these address in the rootless netns as they are not actually the hostns as thus cause great confusion.

For the --network pasta case I already fixed this by returning the ips on the pasta.Setup2() call in b809d72.
For the bridge mode this more complicated due several layers of function calls. I decided to implement this as extra function call on the interface to return the ips as this makes the usage in podman the easiest. And I also didn't want to break the API as we only have to fix this in podman not buildah.

It is needed to address #22653 but it needs podman changes as well to use this new function.

Copy link
Contributor

openshift-ci bot commented May 16, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Luap99

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

Copy link

Ephemeral COPR build failed. @containers/packit-build please check.

When using the bridge network mode as rootless we use the rootless netns
logic, for podman this looks like just as using bridge as root. The
issue is however due the extra namespace we block certain address there.
This can be seen best with pasta but actually effects other cases too.
The podman logic tries to use any host ip address for
host.containers.internal but we must make sure to exculde all these
address in the rootless netns as they are not actually the hostns as
thus cause great confusion.

For the --network pasta case I already fixed this by returning the ips on
the pasta.Setup2() call in b809d72.
For the bridge mode this more complicated due several layers of function
calls. I decided to implement this as extra function call on the interface
to return the ips as this makes the usage in podman the easiest. And I
also didn't want to break the API as we only have to fix this in podman
not buildah.

It is needed to address #22653 but it needs podman changes as well to
use this new function.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
@Luap99 Luap99 marked this pull request as ready for review May 16, 2024 13:45
@Luap99
Copy link
Member Author

Luap99 commented May 16, 2024

@mheon PTAL

@mheon
Copy link
Member

mheon commented May 16, 2024

LGTM

@rhatdan
Copy link
Member

rhatdan commented May 16, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm label May 16, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 907018c into containers:main May 16, 2024
11 of 12 checks passed
@Luap99 Luap99 deleted the rootlessnetns-info branch May 17, 2024 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants