Skip to content

Commit fe8c954

Browse files
authored
Merge pull request #99 from slauger/fix/add-oci-container-runtime
fix: add oci as supported container runtime
2 parents cd291fa + af7efd7 commit fe8c954

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

lib/facter/resolvers/linux/containers.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ def read_environ(fact_name)
5252
vm = 'podman'
5353
when 'crio'
5454
vm = 'crio'
55+
when 'oci'
56+
vm = 'oci'
5557
when 'zone'
5658
return nil
5759
when 'systemd-nspawn'

spec/facter/resolvers/linux/containers_spec.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,20 @@
9292
end
9393
end
9494

95+
context 'when hypervisor is oci and it is discovered by environ' do
96+
let(:cgroup_output) { load_fixture('cgroup_file').read }
97+
let(:environ_output) { ['container=oci'] }
98+
let(:result) { { oci: {} } }
99+
100+
it 'return oci for vm' do
101+
expect(containers_resolver.resolve(:vm)).to eq('oci')
102+
end
103+
104+
it 'return oci info for hypervisor' do
105+
expect(containers_resolver.resolve(:hypervisor)).to eq(result)
106+
end
107+
end
108+
95109
context 'when hypervisor is illumos' do
96110
let(:cgroup_output) { nil }
97111
let(:environ_output) { ['container=zone'] }

0 commit comments

Comments
 (0)