Skip to content

Pattern adapted to determine whether Jenkins is running in a container when podman is used with cgroup v2 #347

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

gentry205
Copy link

The docker-workflow plugin also works perfectly with podman. After switching podman to cgroup v2, it is no longer recognised when Jenkins is running in a podman container. In order for this to work again, the regular expression needs to be adjusted. After the adjustment, the containerid is recognised correctly for both docker and podman. The expression used utilises lookbehind and lookahead expressions to determine the containerid.

Tests are implemented in ContainerisedCGroupV2Test and run without errors.

…r when podman is used with cgroup v2

The docker-workflow plugin also works perfectly with podman. After switching podman to cgroup v2, it is no longer recognised when Jenkins is running in a podman container. In order for this to work again, the regular expression needs to be adjusted. After the adjustment, the containerid is recognised correctly for both docker and podman. The expression used utilises lookbehind and lookahead expressions to determine the containerid.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant