Skip to content

Commit a9b13e9

Browse files
committed
On Illumos LX, make Facter::Resolvers::Containers return nil, so Facter::Util::Facts::Posix::VirtualDetector#check_illumos_lx is executed
1 parent eca23ba commit a9b13e9

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

lib/facter/resolvers/containers.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ def read_environ(fact_name)
4949
vm = 'podman'
5050
when 'crio'
5151
vm = 'crio'
52+
when 'zone'
53+
return nil
5254
when 'systemd-nspawn'
5355
vm = 'systemd_nspawn'
5456
info = { 'id' => Facter::Util::FileHelper.safe_read('/etc/machine-id', nil).strip }

spec/facter/resolvers/containers_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@
7878
end
7979
end
8080

81+
context 'when hypervisor is illumos' do
82+
let(:cgroup_output) { nil }
83+
let(:environ_output) { ['container=zone'] }
84+
85+
it 'return nil' do
86+
expect(containers_resolver.resolve(:vm)).to eq(nil)
87+
expect(containers_resolver.resolve(:hypervisor)).to eq(nil)
88+
end
89+
end
90+
8191
context 'when hypervisor is neighter lxc nor docker' do
8292
let(:cgroup_output) { load_fixture('cgroup_file').read }
8393
let(:environ_output) { ['PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin'] }

0 commit comments

Comments
 (0)