network namespace issue when used with Gitlab runner #14186
imperialguy
started this conversation in
General
Replies: 1 comment
-
Resolved #14192 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Using podman 3.4 on rhel8
Scenario 1
I have a shell script (let's call it
prepare.sh
) with just the following line in it:podman run -d docker.io/library/alpine:latest
The above script is called by: a.) shell; b.) a Gitlab runner (example) as well. And it works perfectly fine in both cases.
Scenario 2
I make the following minor change:
podman run -d --entrypoint /sbin/init docker.io/library/alpine:latest
or
podman run -d -it docker.io/library/alpine:latest
In other words, the above two modified commands are calling for a perpetual running of the container.
Now, when the above script is called by a.) local shell - it works perfectly fine; b.) But, when it is called by a Gitlab runner, and then when the Gitlab runner does execute that
prepare.sh
script, the following happens:The problem is, for some reason when the same script is called by the Gitlab runner, podman is looking for a network namespace inside a different folder.
So, in the above case, it's looking for a network namespace inside
/tmp/custom-executor886608394/podman-run-1001/netns
instead of just/tmp/podman-run-1001/netns
which is the default location for that user.Also, both the Gitlab runner and manual execution are using the same user.
Not sure if I can really blame it on Gitlab runner, because it ran Scenario 1 without any hiccups. The only modification I made in Scenario 2 is the addition of
--entrypoint
or-it
flags, and all of a sudden it leads to the network namespace error i.e., only when called by the Gitlab runner.Any ideas/thoughts?
Beta Was this translation helpful? Give feedback.
All reactions