-
Notifications
You must be signed in to change notification settings - Fork 18.1k
syscall,net: tests fail within a Podman container #58114
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
Comments
I would suggest filing separate issues for each of the three packages, since the fixes are presumably independent. |
The The test is assuming that UID 0 implies “able to open raw IP sockets”, but that assumption does not hold in a container environment. |
@userid0x0, want to send a CL to fix the (CC @ianlancetaylor @neild) |
@bcmills I am neither a |
Probably not: the POSIX extension specifying In general, the more robust approach is to just go ahead and make the system calls and then check the return values for error codes that look like container permission errors ( |
I tested against |
Change https://go.dev/cl/476216 mentions this issue: |
Change https://go.dev/cl/476217 mentions this issue: |
This allows to use this helper function in packages other than syscall, namely package net. For #58114 Change-Id: I72c59ab013e9195801ff1315019ae1aef4396287 Reviewed-on: https://go-review.googlesource.com/c/go/+/476216 Auto-Submit: Tobias Klauser <[email protected]> Reviewed-by: Cherry Mui <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Tobias Klauser <[email protected]> Reviewed-by: Bryan Mills <[email protected]>
What version of Go are you using (
go version
)?I want to compile the latest version within podman. Debian bullseye is shipped with go 1.15 .
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I tried to build Go within a Podman Container
The following tests fail:
What did you expect to see?
I expect that Go detects it's running within a (podman) container and the tests succeed. Such a test might look as follows:
Adding it to exec_linux_test.go should be straight forward:
https://github.com/golang/go/blob/master/src/syscall/exec_linux_test.go#L38
. For the other tests i am using
--cap-add NET_RAW
for the moment.What did you see instead?
The text was updated successfully, but these errors were encountered: