Class: Rhelm::Subcommand::Dependency

Inherits:
Base
  • Object
show all
Defined in:
lib/rhelm/subcommand/dependency.rb

Overview

Helm dependency subcommand: ‘helm dependency COMMAND CHART [flags]`. docs: helm.sh/docs/helm/helm_dependency/

Constant Summary collapse

COMMANDS =
%w(update)

Instance Attribute Summary collapse

Attributes inherited from Base

#client, #debug, #kube_apiserver, #kube_as_group, #kube_as_user, #kube_context, #kube_token, #kubeconfig, #namespace, #registry_config, #repository_cache, #repository_config

Instance Method Summary collapse

Methods inherited from Base

#args, #full_cli_call, #report_failure, #run

Constructor Details

#initialize(command, chart, options = {}) ⇒ Dependency

Returns a new instance of Dependency.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/rhelm/subcommand/dependency.rb', line 17

def initialize(command, chart, options = {})
  super(options)

  @command = command.to_s
  unless COMMANDS.include?(command)
    raise(OptionError, "Invalid command #{command}. Valid values are: #{COMMANDS.join(', ')}")
  end

  @chart = chart
  @help = !!options[:help]
  @keyring = options[:keyring]
  @skip_refresh = !!options[:skip_refresh]
  @verify = !!options[:verify]
end

Instance Attribute Details

#chartObject (readonly)

Returns the value of attribute chart.



8
9
10
# File 'lib/rhelm/subcommand/dependency.rb', line 8

def chart
  @chart
end

#commandObject (readonly)

Returns the value of attribute command.



8
9
10
# File 'lib/rhelm/subcommand/dependency.rb', line 8

def command
  @command
end

#helpObject (readonly)

Returns the value of attribute help.



8
9
10
# File 'lib/rhelm/subcommand/dependency.rb', line 8

def help
  @help
end

#keyringObject (readonly)

Returns the value of attribute keyring.



8
9
10
# File 'lib/rhelm/subcommand/dependency.rb', line 8

def keyring
  @keyring
end

#skip_refreshObject (readonly)

Returns the value of attribute skip_refresh.



8
9
10
# File 'lib/rhelm/subcommand/dependency.rb', line 8

def skip_refresh
  @skip_refresh
end

#verifyObject (readonly)

Returns the value of attribute verify.



8
9
10
# File 'lib/rhelm/subcommand/dependency.rb', line 8

def verify
  @verify
end

Instance Method Details

#cli_argsObject



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/rhelm/subcommand/dependency.rb', line 36

def cli_args
  super.tap do |args|
    args << '--help' if help
    args << ['--keyring', keyring] if keyring
    args << '--skip-refresh' if skip_refresh
    args << '--verify' if verify

    args << command
    args << chart
  end.flatten
end

#subcommand_nameObject



32
33
34
# File 'lib/rhelm/subcommand/dependency.rb', line 32

def subcommand_name
  "dependency"
end