Skip to content

Failed to detect container environment when using cgroups #12721

Closed
@tpambor

Description

@tpambor

IsContainerized returns false when executed in a container using cgroupns as /proc/1/cgroup is just 0::/ due to cgroup namespacing in the container.

Please consider also checking for /sys/fs/cgroup/cgroup.type in these cases. See for example the container detection in systemd, https://github.com/systemd/systemd/blob/main/src/basic/virt.c#L593.

Metadata

Metadata

Labels

cliArea: CLIs4Internal bugs (e.g. test flakes), extreme edge cases, and bug risks

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions