Skip to content

Commit

Permalink
Add redhat support to docker hypervisor
Browse files Browse the repository at this point in the history
  • Loading branch information
h0tw1r3 committed Mar 13, 2024
1 parent d7cf990 commit fc3b717
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/beaker-hostgenerator/hypervisor/docker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def generate_node(node_info, base_config, bhg_version)
end

base_config['image'] = image(ostype)
base_config['image'].prepend('amd64/') if node_info['bits'] == '64' && !base_config['image'].start_with?('quay.io/')
base_config['image'].prepend('amd64/') if node_info['bits'] == '64' && !base_config['image'].start_with?('quay.io/', 'registry.access.redhat.com/')

base_generate_node(node_info, base_config, bhg_version, :docker)
end
Expand All @@ -32,6 +32,9 @@ def image(ostype)
version = ostype.delete_prefix('centos')
tag = (version.to_i >= 8) ? "stream#{version}" : "centos#{version}"
image = "quay.io/centos/centos:#{tag}"
when /^redhat/
version = ostype.delete_prefix('redhat')
image = "registry.access.redhat.com/ubi#{version}/ubi-init:latest"
when /^oracle/
image.sub!(/\w+/, 'oraclelinux')
when /^opensuse/
Expand All @@ -49,7 +52,7 @@ def image(ostype)

def image_commands(ostype)
case ostype
when /^(almalinux|centos|rocky|oracle)/
when /^(almalinux|centos|rocky|oracle|redhat)/
[
'cp /bin/true /sbin/agetty',
el_package_install_command(ostype.delete_prefix(Regexp.last_match(1)).to_i),
Expand Down

0 comments on commit fc3b717

Please sign in to comment.