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

Resolving the virtual fact on FreeBSD produce warning #2742

Open
smortex opened this issue Jul 30, 2024 · 4 comments
Open

Resolving the virtual fact on FreeBSD produce warning #2742

smortex opened this issue Jul 30, 2024 · 4 comments
Labels
accepted Valid issue that we intend to work on when we have the bandwidth bug Something isn't working

Comments

@smortex
Copy link
Contributor

smortex commented Jul 30, 2024

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:

  1. 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;
  2. 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.
@bibi21000
Copy link

same problem here in a lxc container with Ubuntu 22.04 and Ubuntu 20.04

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

@joshcooper
Copy link
Contributor

@bibi21000 you're running into #2737

@bibi21000
Copy link

@joshcooper ty for information

@buzzdeee
Copy link
Contributor

same here on OpenBSD with facter 4.8.0:

facter33 virtual
[2024-08-19 08:04:38.279003 ] WARN Facter::Resolvers::Containers - Unable to getenv for pid 1, 'uninitialized constant Facter::Util::Linux'
physical

@joshcooper joshcooper added the accepted Valid issue that we intend to work on when we have the bandwidth label Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Valid issue that we intend to work on when we have the bandwidth bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants