- 
                Notifications
    You must be signed in to change notification settings 
- Fork 495
Open
Labels
bugSomething isn't workingSomething isn't workingtriagedJira issue has been created for thisJira issue has been created for this
Description
Describe the Bug
When running Puppet Facter inside a Docker container, the hypervisors and virtual facts are incorrectly set. Additionally, a warning is displayed:
Warning: Facter: Container runtime, 'docker', is unsupported, setting to, 'container_other'.
Example Output:
# facter -p hypervisors
[2024-11-27 13:49:35.972235 ] WARN Facter::Resolvers::Containers - Container runtime, 'docker', is unsupported, setting to, 'container_other'
# facter -p virtual
[2024-11-27 13:49:42.488042 ] WARN Facter::Resolvers::Containers - Container runtime, 'docker', is unsupported, setting to, 'container_other'
container_otherExpected Behavior
In previous versions (e.g., Tag 4.7.0), the hypervisors and virtual facts returned the correct values:
# facter -p hypervisors
{
  docker => {
    id => "<STRING_ID>"
  }
}
# facter -p virtual
dockerSteps to Reproduce
- Run Puppet Agent/Facter inside a Docker container.
- Execute the command facter -p hypervisorsorfacter -p virtual.
Environment
- Version: Puppet Agent 7.32.1
- Platform: Ubuntu 24.04
- Facter Version: 4.8.0
Additional Context
After debugging the repository, I identified the root cause in the following line within lib/facter/resolvers/containers.rb:
read_environ(fact_name) || read_cgroup(fact_name)The call to read_environ(fact_name) always returns a value, which prevents read_cgroup(fact_name) from being executed. This causes the resolver to misidentify the container runtime and set incorrect values for the hypervisors and virtual facts.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingtriagedJira issue has been created for thisJira issue has been created for this