Open
Description
Describe the Bug
root@puppet:~ # facter --version
4.8.0
root@puppet:~ # facter virtual
[2024-07-30 09:30:11.629353 ] WARN Facter::Resolvers::Containers - Unable to getenv for pid 1, 'uninitialized constant Facter::Util::Linux'
jail
Expected Behavior
root@puppet:~ # facter virtual
jail
No warning about something that looks suspiciously Linux-related :-)
Steps to Reproduce
Run facter 4.8.0 on a FreeBSD system
Environment
- Version 4.8.0
- Platform FreeBSD
Additional Context
The problem is incidentally introduced by #2574 where Linux specific code is added to lib/facter/resolvers/containers.rb
, a file which based on its name is supposed to be platform-agnostic.
After further investigation, this file is really platform-specific and not in the right directory. A few other files have the same problem. I will open two PR to:
- Fix files located in the wrong directory to make it explicit if they are specific to a platform or not: Ensure platform-specific code is correctly namespaced #2743;
- Change the way the virtual fact is resolved on FreeBSD to stop the warning from being produced: Fix resolution of the
virtual
fact on FreeBSD #2744.