Skip to content
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

Commit 7bc38ccb has broken libvirt-lxc containers detection #2759

Open
turchanov opened this issue Sep 21, 2024 · 4 comments
Open

Commit 7bc38ccb has broken libvirt-lxc containers detection #2759

turchanov opened this issue Sep 21, 2024 · 4 comments
Labels
bug Something isn't working triaged Jira issue has been created for this

Comments

@turchanov
Copy link

turchanov commented Sep 21, 2024

Commit 7bc38cc that solves FACT-3202 has broken libvirt-lxc containers detection

Warning: Facter: Container runtime, 'lxc-libvirt', is unsupported, setting to 'container_other'

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 runtime

https://github.com/puppetlabs/facter/blame/05e4387c8de085a44ff5cfbe02081703dbbf5d60/lib/facter/resolvers/containers.rb#L27

          lxc_from_environ = /container=lxc/ =~ output_environ
@turchanov turchanov added the bug Something isn't working label Sep 21, 2024
@joshcooper
Copy link
Contributor

Thanks @turchanov @lollipopman and I were discussing whether it should be a prefix or exact match in #2741 (comment) And it sounds like prefix match is preferred. Can you describe steps to reproduce like I did in #2741 (comment)

@lollipopman
Copy link
Contributor

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",

@turchanov
Copy link
Author

turchanov commented Sep 28, 2024

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)

@joshcooper joshcooper added the triaged Jira issue has been created for this label Oct 3, 2024
Copy link

github-actions bot commented Oct 3, 2024

Migrated issue to FACT-3484

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triaged Jira issue has been created for this
Projects
None yet
Development

No branches or pull requests

3 participants