Skip to content

Commit e0f379e

Browse files
authored
Merge pull request puppetlabs#2772 from smokris/container-illumos-lx-zone
Fix `virtual` resolution on Illumos LX
2 parents 75a20f3 + 31d32da commit e0f379e

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
@@ -51,6 +51,8 @@ def read_environ(fact_name)
5151
vm = 'podman'
5252
when 'crio'
5353
vm = 'crio'
54+
when 'zone'
55+
return nil
5456
when 'systemd-nspawn'
5557
vm = 'systemd_nspawn'
5658
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
@@ -92,6 +92,16 @@
9292
end
9393
end
9494

95+
context 'when hypervisor is illumos' do
96+
let(:cgroup_output) { nil }
97+
let(:environ_output) { ['container=zone'] }
98+
99+
it 'return nil' do
100+
expect(containers_resolver.resolve(:vm)).to eq(nil)
101+
expect(containers_resolver.resolve(:hypervisor)).to eq(nil)
102+
end
103+
end
104+
95105
context 'when hypervisor is neighter lxc nor docker' do
96106
let(:cgroup_output) { load_fixture('cgroup_file').read }
97107
let(:environ_output) { ['PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin'] }

0 commit comments

Comments
 (0)