Sha256: 2ef0ced59d3fa3343b92051107d7a6800b14aef168838c4f7074b11699428db5

Contents?: true

Size: 922 Bytes

Versions: 20

Compression:

Stored size: 922 Bytes

Contents

# frozen_string_literal: true

require 'lino'
require_relative 'base'

module RubyHelm
  module Commands
    class Upgrade < Base
      # rubocop:disable Metrics/MethodLength
      def configure_command(builder, opts)
        release = opts[:release]
        chart = opts[:chart]
        values = opts[:values] || {}
        should_install = opts[:install]

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

        builder.with_subcommand('upgrade') do |sub|
          unless values.empty?
            sub = sub.with_option(
              '--set',
              paired_values.join(','),
              separator: ' '
            )
          end
          sub = sub.with_flag('--install') if should_install
          sub
        end
               .with_argument(release)
               .with_argument(chart)
      end
      # rubocop:enable Metrics/MethodLength
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ruby_helm-0.6.0.pre.2 lib/ruby_helm/commands/upgrade.rb
ruby_helm-0.6.0.pre.1 lib/ruby_helm/commands/upgrade.rb
ruby_helm-0.5.0 lib/ruby_helm/commands/upgrade.rb
ruby_helm-0.4.0.pre.6 lib/ruby_helm/commands/upgrade.rb
ruby_helm-0.4.0.pre.5 lib/ruby_helm/commands/upgrade.rb
ruby_helm-0.4.0.pre.4 lib/ruby_helm/commands/upgrade.rb
ruby_helm-0.4.0.pre.3 lib/ruby_helm/commands/upgrade.rb
ruby_helm-0.4.0.pre.2 lib/ruby_helm/commands/upgrade.rb
ruby_helm-0.4.0.pre.1 lib/ruby_helm/commands/upgrade.rb
ruby_helm-0.3.0 lib/ruby_helm/commands/upgrade.rb
ruby_helm-0.2.0.pre.10 lib/ruby_helm/commands/upgrade.rb
ruby_helm-0.2.0.pre.9 lib/ruby_helm/commands/upgrade.rb
ruby_helm-0.2.0.pre.8 lib/ruby_helm/commands/upgrade.rb
ruby_helm-0.2.0.pre.7 lib/ruby_helm/commands/upgrade.rb
ruby_helm-0.2.0.pre.6 lib/ruby_helm/commands/upgrade.rb
ruby_helm-0.2.0.pre.5 lib/ruby_helm/commands/upgrade.rb
ruby_helm-0.2.0.pre.4 lib/ruby_helm/commands/upgrade.rb
ruby_helm-0.2.0.pre.3 lib/ruby_helm/commands/upgrade.rb
ruby_helm-0.2.0.pre.2 lib/ruby_helm/commands/upgrade.rb
ruby_helm-0.2.0.pre.1 lib/ruby_helm/commands/upgrade.rb