lib/ruby_helm/commands/upgrade.rb in ruby_helm-0.1.2 vs lib/ruby_helm/commands/upgrade.rb in ruby_helm-0.2.0.pre.1
- old
+ new
@@ -1,11 +1,14 @@
+# 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]
@@ -13,18 +16,22 @@
paired_values = values.map do |key, value|
"#{key}=#{value}"
end
builder.with_subcommand('upgrade') do |sub|
- sub = sub.with_option(
+ unless values.empty?
+ sub = sub.with_option(
'--set',
- paired_values.join(","),
- separator: ' ') unless values.empty?
+ paired_values.join(','),
+ separator: ' '
+ )
+ end
sub = sub.with_flag('--install') if should_install
sub
end
- .with_argument(release)
- .with_argument(chart)
+ .with_argument(release)
+ .with_argument(chart)
end
+ # rubocop:enable Metrics/MethodLength
end
end
end