Sha256: 23d035d38bdcaad62cfc77eccacce3ac65cf852c2f59d0b7c25e7578485d9547

Contents?: true

Size: 757 Bytes

Versions: 2

Compression:

Stored size: 757 Bytes

Contents

require 'lino'
require_relative 'base'

module RubyHelm
  module Commands
    class Upgrade < Base
      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|
          sub = sub.with_option(
              '--set',
              paired_values.join(","),
              separator: ' ') unless values.empty?
          sub = sub.with_flag('--install') if should_install
          sub
        end
            .with_argument(release)
            .with_argument(chart)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby_helm-0.1.2 lib/ruby_helm/commands/upgrade.rb
ruby_helm-0.1.0 lib/ruby_helm/commands/upgrade.rb