Sha256: f424fff20ade1ec612dcc3fbd8a375540bd9960c4879f47b032effbbdc4e328f

Contents?: true

Size: 734 Bytes

Versions: 8

Compression:

Stored size: 734 Bytes

Contents

require 'yaml'
require_relative 'service_generator'

module Kontena::Cli::Apps
  class ServiceGeneratorV2 < ServiceGenerator

    def parse_data(options)
      data = super(options)
      data['net'] = options['network_mode'] if options['network_mode']
      data['log_driver'] = options.dig('logging', 'driver')
      data['log_opts'] = options.dig('logging', 'options')
      if options['depends_on']
        data['links'] ||= []
        data['links'] = (data['links'] + parse_links(options['depends_on'])).uniq
      end
      data
    end

    def parse_build_options(options)
      unless options['build'].is_a?(Hash)
        options['build'] = { 'context' => options['build']}
      end
      options['build']
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
kontena-cli-0.14.7 lib/kontena/cli/apps/service_generator_v2.rb
kontena-cli-0.14.6 lib/kontena/cli/apps/service_generator_v2.rb
kontena-cli-0.14.5 lib/kontena/cli/apps/service_generator_v2.rb
kontena-cli-0.14.4 lib/kontena/cli/apps/service_generator_v2.rb
kontena-cli-0.14.3 lib/kontena/cli/apps/service_generator_v2.rb
kontena-cli-0.14.2 lib/kontena/cli/apps/service_generator_v2.rb
kontena-cli-0.14.1 lib/kontena/cli/apps/service_generator_v2.rb
kontena-cli-0.14.0 lib/kontena/cli/apps/service_generator_v2.rb