Class: Rhelm::Subcommand::Install

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

Overview

Helm install subcommand: ‘helm install [NAME] [CHART] [flags]`. docs: helm.sh/docs/helm/helm_install/

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(release, chart, options = {}) ⇒ Install

Returns a new instance of Install.



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/rhelm/subcommand/install.rb', line 44

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

  @release = release
  @chart = chart
  @atomic = options[:atomic]
  @ca_file = options[:ca_file]
  @cert_file = options[:cert_file]
  @create_namespace = options[:create_namespace]
  @dependency_update = options[:dependency_update]
  @description = options[:description]
  @devel = !!options[:devel]
  @disable_openapi_validation = !!options[:disable_openapi_validation]
  @dry_run = options[:dry_run]
  @generate_name = options[:generate_name]
  @insecure_skip_tls_verify = options[:insecure_skip_tls_verify]
  @key_file = options[:key_file]
  @keyring = options[:keyring]
  @name_template = options[:name_template]
  @no_hooks = options[:no_hooks]
  @output = options[:output]
  @pass_credentials = options[:pass_credentials]
  @password = options[:password]
  @post_renderer = options[:post_renderer]
  @render_subchart_notes = options[:render_subchart_notes]
  @replace = options[:replace]
  @repo = options[:repo]
  @set = options[:set]
  @set_file = options[:set_file]
  @set_string = options[:set_string]
  @skip_crds = options[:skip_crds]
  @timeout = options[:timeout]
  @username = options[:username]
  @values = options[:values]
  @verify = options[:verify]
  @version = options[:version]
  @wait = options[:wait]
  @wait_for_jobs = options[:wait_for_jobs]
end

Instance Attribute Details

#atomicObject (readonly)

Returns the value of attribute atomic.



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

def atomic
  @atomic
end

#ca_fileObject (readonly)

Returns the value of attribute ca_file.



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

def ca_file
  @ca_file
end

#cert_fileObject (readonly)

Returns the value of attribute cert_file.



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

def cert_file
  @cert_file
end

#chartObject (readonly)

Returns the value of attribute chart.



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

def chart
  @chart
end

#create_namespaceObject (readonly)

Returns the value of attribute create_namespace.



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

def create_namespace
  @create_namespace
end

#dependency_updateObject (readonly)

Returns the value of attribute dependency_update.



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

def dependency_update
  @dependency_update
end

#descriptionObject (readonly)

Returns the value of attribute description.



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

def description
  @description
end

#develObject (readonly)

Returns the value of attribute devel.



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

def devel
  @devel
end

#disable_openapi_validationObject (readonly)

Returns the value of attribute disable_openapi_validation.



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

def disable_openapi_validation
  @disable_openapi_validation
end

#dry_runObject (readonly)

Returns the value of attribute dry_run.



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

def dry_run
  @dry_run
end

#generate_nameObject (readonly)

Returns the value of attribute generate_name.



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

def generate_name
  @generate_name
end

#insecure_skip_tls_verifyObject (readonly)

Returns the value of attribute insecure_skip_tls_verify.



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

def insecure_skip_tls_verify
  @insecure_skip_tls_verify
end

#key_fileObject (readonly)

Returns the value of attribute key_file.



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

def key_file
  @key_file
end

#keyringObject (readonly)

Returns the value of attribute keyring.



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

def keyring
  @keyring
end

#name_templateObject (readonly)

Returns the value of attribute name_template.



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

def name_template
  @name_template
end

#no_hooksObject (readonly)

Returns the value of attribute no_hooks.



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

def no_hooks
  @no_hooks
end

#outputObject (readonly)

Returns the value of attribute output.



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

def output
  @output
end

#pass_credentialsObject (readonly)

Returns the value of attribute pass_credentials.



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

def pass_credentials
  @pass_credentials
end

#passwordObject (readonly)

Returns the value of attribute password.



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

def password
  @password
end

#post_rendererObject (readonly)

Returns the value of attribute post_renderer.



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

def post_renderer
  @post_renderer
end

#releaseObject (readonly)

Returns the value of attribute release.



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

def release
  @release
end

#render_subchart_notesObject (readonly)

Returns the value of attribute render_subchart_notes.



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

def render_subchart_notes
  @render_subchart_notes
end

#replaceObject (readonly)

Returns the value of attribute replace.



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

def replace
  @replace
end

#repoObject (readonly)

Returns the value of attribute repo.



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

def repo
  @repo
end

#setObject (readonly)

Returns the value of attribute set.



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

def set
  @set
end

#set_fileObject (readonly)

Returns the value of attribute set_file.



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

def set_file
  @set_file
end

#set_stringObject (readonly)

Returns the value of attribute set_string.



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

def set_string
  @set_string
end

#skip_crdsObject (readonly)

Returns the value of attribute skip_crds.



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

def skip_crds
  @skip_crds
end

#timeoutObject (readonly)

Returns the value of attribute timeout.



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

def timeout
  @timeout
end

#usernameObject (readonly)

Returns the value of attribute username.



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

def username
  @username
end

#valuesObject (readonly)

Returns the value of attribute values.



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

def values
  @values
end

#verifyObject (readonly)

Returns the value of attribute verify.



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

def verify
  @verify
end

#versionObject (readonly)

Returns the value of attribute version.



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

def version
  @version
end

#waitObject (readonly)

Returns the value of attribute wait.



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

def wait
  @wait
end

#wait_for_jobsObject (readonly)

Returns the value of attribute wait_for_jobs.



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

def wait_for_jobs
  @wait_for_jobs
end

Instance Method Details

#cli_argsObject



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/rhelm/subcommand/install.rb', line 88

def cli_args
  super.tap do |args|
    args << '--atomic' if atomic
    args << ['--ca-file', ca_file] if ca_file
    args << ['--cert-file', cert_file] if cert_file
    args << '--create-namespace' if create_namespace
    args << '--dependency-update' if dependency_update
    args << ['--description', description] if description
    args << '--devel' if devel
    args << '--disable-openapi-validation' if disable_openapi_validation
    args << '--dry-run' if dry_run
    args << '--generate-name' if generate_name
    args << '--insecure-skip-tls-verify' if insecure_skip_tls_verify
    args << ['--key-file', key_file] if key_file
    args << ['--keyring', keyring] if keyring
    args << ['--name-template', name_template] if name_template
    args << '--no-hooks' if no_hooks
    args << ['--output', output] if output
    args << '--pass-credentials' if pass_credentials
    args << ['--password', password] if password
    args << ['--post-renderer', post_renderer] if post_renderer
    args << '--render-subchart-notes' if render_subchart_notes
    args << '--replace' if replace
    args << ['--repo', repo] if repo

    if set && !set.empty?
      case set
      when Hash
        args << set.map { |key, value| ['--set', "#{key}=#{value}" ] }.flatten
      else
        args << ['--set', set]
      end
    end

    if set_file && !set_file.empty?
      case set_file
      when Hash
        args << set_file.map { |key, value| ['--set-file', "#{key}=#{value}" ] }.flatten
      else
        args << ['--set-file', set_file]
      end
    end

    if set_string && !set_string.empty?
      case set_string
      when Hash
        args << set_string.map { |key, value| ['--set-string', "#{key}=#{value}" ] }.flatten
      else
        args << ['--set-string', set_string]
      end
    end

    args << '--skip-crds' if skip_crds
    args << ['--timeout', timeout] if timeout
    args << ['--username', username] if username

    if values && !values.empty?
      case values
      when Array
        args << values.map { |values_file| ['--values', values_file ] }.flatten
      else
        args << ['--values', values]
      end
    end

    args << '--verify' if verify
    args << ['--version', version] if version
    args << '--wait' if wait
    args << '--wait-for-jobs' if wait_for_jobs

    args << release
    args << chart
  end.flatten
end

#subcommand_nameObject



84
85
86
# File 'lib/rhelm/subcommand/install.rb', line 84

def subcommand_name
  "install"
end