Do not error out in port detection if any of the /proc/net/{tc,ud}p{,6} files are missing in the dev container#6831
Conversation
… files are missing
/proc/net/{tc,ud}p6 files might be missing if IPv6 is disabled in the host networking stack,
as reported by a user on RHEL.
Actually /proc/net/{tc,ud}p* files might be totally missing if network stats are disabled.
…n the loopback interface We are already displaying a warning in such case (saying that port forwarding might not work correctly); so this should not prevent port-forwarding messages to be displayed. We are already behaving this way when detecting if endpoints in the Devfile are actually opened in the container. A warning is displayed if any error occurs while checking this.
✅ Deploy Preview for odo-docusaurus-preview ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
|
my tests returns : if i escape the $ sign : |
Yes, I think it should also work with simple quotes with no need to escape anything: podman exec -it go-app-runtime /bin/sh -c 'for f in tcp udp tcp6 udp6; do cat /proc/net/$f || true; done'At least, that's how the command would get passed to the container by |
Issue with interactive tests - being addressed in #6830 /override OpenShift-Integration-tests/OpenShift-Unauth-Integration-tests |
|
@rm3l: Overrode contexts on behalf of rm3l: OpenShift-Integration-tests/OpenShift-Unauth-Integration-tests DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
pkg/port/port.go
Outdated
| "cat /proc/net/tcp /proc/net/udp /proc/net/tcp6 /proc/net/udp6", | ||
| // /proc/net/{tc,ud}p6 files might be missing if IPv6 is disabled in the host networking stack. | ||
| // Actually /proc/net/{tc,ud}p* files might be totally missing if network stats are disabled. | ||
| "for f in tcp udp tcp6 udp6; do cat /proc/net/$f || true; done", |
There was a problem hiding this comment.
You could also keep the previous command, which will display the files found and display an error for not found ones.
There was a problem hiding this comment.
Yes, we can do that. I didn't want to stop returning the content of the subsequent files if any file in the middle does not exist, but that seems to be already the case here.
…}p{,6}` files are missing
|
Kudos, SonarCloud Quality Gate passed!
|
Network issues in those tests - tracked in #6838 /override windows-integration-test/Windows-test |
|
@rm3l: Overrode contexts on behalf of rm3l: windows-integration-test/Windows-test DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |








What type of PR is this:
/kind bug
/area odo-on-podman
What does this PR do / why we need it:
This PR makes port detection a bit resilient if any of the
/proc/net/{tc,ud}p*are missing in the container.For example,
/proc/net/{tc,ud}p6files might be missing if IPv6 is disabled in the host networking stack, as reported for instance on RHEL (context of #6824). Actually,/proc/net/{tc,ud}p*files might even be totally missing if network stats are disabled in the kernel configuration.Which issue(s) this PR fixes:
Related to #6824
PR acceptance criteria:
Unit test
Integration test
Documentation
How to test changes / Special notes to the reviewer: