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

Inspect network info of a joined network namespace #13366

Conversation

idleroamer
Copy link
Contributor

@idleroamer idleroamer commented Feb 27, 2022

Display network info of a joined network namespace upon inspect
Join network namespace and query interfaces/IPs/gateway

Closes: #13150
Signed-off-by: 😎 Mostafa Emami [email protected]

@mheon
Copy link
Member

mheon commented Feb 28, 2022

@cevich @baude Is CI busted on upstream? These errors look unrelated

@Luap99
Copy link
Member

Luap99 commented Feb 28, 2022

I think your changes are breaking the tests because you do not handle setns correctly. Please use github.com/containernetworking/plugins/pkg/ns to join the netns since this has a much better interface, see https://github.com/containers/common/blob/210e51ddd5b2043168dd0d625b9fe49ade1d6510/libnetwork/cni/run.go#L39

@cevich
Copy link
Member

cevich commented Feb 28, 2022

Hint: You can always check the status of 'main' here: https://cirrus-ci.com/github/containers/podman/main I agree with Paul, these don't look like systemic errors/failings.

@idleroamer idleroamer force-pushed the inspect-joined-network-ns-main branch 9 times, most recently from f4f6c7b to 1f2ad7a Compare March 2, 2022 21:16
test/e2e/run_networking_test.go Outdated Show resolved Hide resolved
test/e2e/run_networking_test.go Outdated Show resolved Hide resolved
test/e2e/run_networking_test.go Outdated Show resolved Hide resolved
test/e2e/run_networking_test.go Outdated Show resolved Hide resolved
@idleroamer idleroamer force-pushed the inspect-joined-network-ns-main branch 7 times, most recently from d0275c8 to f6f2385 Compare March 6, 2022 06:59
@idleroamer
Copy link
Contributor Author

idleroamer commented Mar 6, 2022

@Luap99 @mheon thanks for the support. I found the culprit, it turned out usage of the following causes random failures in other test-cases on CI, no idea though why.
https://pkg.go.dev/github.com/vishvananda/netns#NewNamed

libpod/networking_linux.go Outdated Show resolved Hide resolved
libpod/networking_linux.go Outdated Show resolved Hide resolved
subnets := make([]types.NetAddress, 0)
for _, address := range addrs {
if ipnet, ok := address.(*net.IPNet); ok {
subnets = append(subnets, types.NetAddress{
Copy link
Member

Choose a reason for hiding this comment

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

I think you should skip ipv6 link local addresses

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

libpod/networking_linux.go Outdated Show resolved Hide resolved
libpod/networking_linux.go Outdated Show resolved Hide resolved

It("podman run newtork inspect fails gracefully on non-reachable network ns", func() {
SkipIfRootless("ip netns is not supported for rootless users")
SkipIfContainerized("Cannot be run within a container.")
Copy link
Member

Choose a reason for hiding this comment

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

Cannot be run within a container, why? please provide the reason for this in the message

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 thought we can't create further network namespace inside container, but let's see if I was wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Obviously I was wrong, so removed SkipIfContainerized.

Copy link
Contributor Author

@idleroamer idleroamer Mar 8, 2022

Choose a reason for hiding this comment

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

Ok, I should add since I removed the SkipIfContainerized it seems that following setup presents a flake
https://cirrus-ci.com/task/5610690273607680
int podman fedora-35 rootless host

[+2250s] Summarizing 3 Failures:
[+2250s] 
[+2250s] [Fail] podman system service verify pprof endpoints [It] are not available 
[+2250s] /var/tmp/go/src/github.com/containers/podman/test/e2e/system_service_test.go:117

I can't establish any link to these test-cases though.

Copy link
Member

Choose a reason for hiding this comment

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

Don't worry about this one: #12624

We can restart failed tests manually.

test/e2e/run_networking_test.go Outdated Show resolved Hide resolved
@idleroamer idleroamer force-pushed the inspect-joined-network-ns-main branch 5 times, most recently from 39d31e1 to a4da9c7 Compare March 6, 2022 21:59
@idleroamer idleroamer force-pushed the inspect-joined-network-ns-main branch 2 times, most recently from 9965838 to 3eaec1d Compare March 7, 2022 18:20
@TomSweeneyRedHat
Copy link
Member

Happy green test buttons. LGTM, but would like @jwhonce and @Luap99 to take a look again.

@idleroamer idleroamer force-pushed the inspect-joined-network-ns-main branch 2 times, most recently from 501776d to 20244fa Compare March 8, 2022 08:28
@idleroamer idleroamer force-pushed the inspect-joined-network-ns-main branch from 20244fa to 611b45c Compare March 8, 2022 10:01
@rhatdan
Copy link
Member

rhatdan commented Mar 8, 2022

@mheon @Luap99 PTAL

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.

LGTM

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 8, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: idleroamer, 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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 8, 2022
@Luap99
Copy link
Member

Luap99 commented Mar 8, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 8, 2022
@openshift-merge-robot openshift-merge-robot merged commit f33b64d into containers:main Mar 8, 2022
@idleroamer idleroamer deleted the inspect-joined-network-ns-main branch March 8, 2022 16:20
@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 Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

podman inspect does not show network info on a joined network namespace
8 participants