Class: RubyHelm::Commands::Install

Inherits:
Base
  • Object
show all
Defined in:
lib/ruby_helm/commands/install.rb

Instance Attribute Summary

Attributes inherited from Base

#binary

Instance Method Summary collapse

Methods inherited from Base

#do_after, #do_before, #execute, #initialize, #instantiate_builder, #stderr, #stdin, #stdout

Constructor Details

This class inherits a constructor from RubyHelm::Commands::Base

Instance Method Details

#configure_command(builder, opts) ⇒ Object

rubocop:disable Metrics/MethodLength



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/ruby_helm/commands/install.rb', line 10

def configure_command(builder, opts)
  chart = opts[:chart]
  name = opts[:name]
  values = opts[:values] || {}

  paired_values = values.map do |key, value|
    "#{key}=#{value}"
  end

  builder.with_subcommand('install') do |sub|
    unless values.empty?
      sub = sub.with_option(
        '--set',
        paired_values.join(','),
        separator: ' '
      )
    end
    sub = sub.with_option('--name', name, separator: ' ') if name
    sub
  end
         .with_argument(chart)
end