Sha256: c2d4d2391d086a41d89ebd53f69076e6dbcd16c7a6f1ad20a712dff290710c4b

Contents?: true

Size: 721 Bytes

Versions: 2

Compression:

Stored size: 721 Bytes

Contents

require 'beaker-hostgenerator/data'
require 'beaker-hostgenerator/hypervisor'
require 'deep_merge'

module BeakerHostGenerator
  module Hypervisor
    class Docker < BeakerHostGenerator::Hypervisor::Interface
      include BeakerHostGenerator::Data

      def generate_node(node_info, base_config, bhg_version)
        base_config['docker_cmd'] = ['/sbin/init']
        base_config['image'] = node_info['ostype'].sub(/(\d)/, ':\1')
        base_config['image'].sub!(/(\w+)/, '\1/leap') if node_info['ostype'] =~ /^opensuse/
        base_config['image'].sub!(/(\d{2})/, '\1.') if node_info['ostype'] =~ /^ubuntu/

        return base_generate_node(node_info, base_config, bhg_version, :docker)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
beaker-hostgenerator-1.4.0 lib/beaker-hostgenerator/hypervisor/docker.rb
beaker-hostgenerator-1.3.0 lib/beaker-hostgenerator/hypervisor/docker.rb