diff --git a/lib/facter/resolvers/containers.rb b/lib/facter/resolvers/containers.rb index ac02b321df..030d7267a4 100644 --- a/lib/facter/resolvers/containers.rb +++ b/lib/facter/resolvers/containers.rb @@ -51,6 +51,8 @@ def read_environ(fact_name) vm = 'podman' when 'crio' vm = 'crio' + when 'zone' + return nil when 'systemd-nspawn' vm = 'systemd_nspawn' info = { 'id' => Facter::Util::FileHelper.safe_read('/etc/machine-id', nil).strip } diff --git a/spec/facter/resolvers/containers_spec.rb b/spec/facter/resolvers/containers_spec.rb index 87b567d434..64348c3794 100644 --- a/spec/facter/resolvers/containers_spec.rb +++ b/spec/facter/resolvers/containers_spec.rb @@ -92,6 +92,16 @@ end end + context 'when hypervisor is illumos' do + let(:cgroup_output) { nil } + let(:environ_output) { ['container=zone'] } + + it 'return nil' do + expect(containers_resolver.resolve(:vm)).to eq(nil) + expect(containers_resolver.resolve(:hypervisor)).to eq(nil) + end + end + context 'when hypervisor is neighter lxc nor docker' do let(:cgroup_output) { load_fixture('cgroup_file').read } let(:environ_output) { ['PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin'] }