Open turchanov opened 1 month ago
Thanks @turchanov @lollipopman and I were discussing whether it should be a prefix or exact match in https://github.com/puppetlabs/facter/pull/2741#issue-2436362643 And it sounds like prefix match is preferred. Can you describe steps to reproduce like I did in https://github.com/puppetlabs/facter/pull/2741#issuecomment-2261133368
I think adding another case statement would be best, as it is technically another type of container, this is how systemd does it:
[VIRTUALIZATION_SYSTEMD_NSPAWN] = "systemd-nspawn",
[VIRTUALIZATION_LXC_LIBVIRT] = "lxc-libvirt",
[VIRTUALIZATION_LXC] = "lxc",
[VIRTUALIZATION_OPENVZ] = "openvz",
[VIRTUALIZATION_DOCKER] = "docker",
[VIRTUALIZATION_PODMAN] = "podman",
[VIRTUALIZATION_RKT] = "rkt",
[VIRTUALIZATION_WSL] = "wsl",
[VIRTUALIZATION_PROOT] = "proot",
[VIRTUALIZATION_POUCH] = "pouch",
[VIRTUALIZATION_CONTAINER_OTHER] = "container-other",
Sorry for delay, I am struggling to provide steps to reproduce the bug... (We have a custom procedure to setup lxc containers in libvirt, and I am still looking for the solution)
Migrated issue to FACT-3484
Commit 7bc38ccb that solves FACT-3202 has broken libvirt-lxc containers detection
Before the commit facter code in
read_cgroup
matched "lxc" on a prefix match, that is any container runtime that was named with prefix "lxc" would have satisfied the test, and an environment string "container=lxc-libvirt" will be detected as a container runtimehttps://github.com/puppetlabs/facter/blame/05e4387c8de085a44ff5cfbe02081703dbbf5d60/lib/facter/resolvers/containers.rb#L27