libnetwork: add option to return rootless-netns ips #1998
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.