Class: Rhelm::Subcommand::Status

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

Overview

Helm status subcommand: ‘helm status RELEASE_NAME [flags]`. docs: helm.sh/docs/helm/helm_status/

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_name, options = {}) ⇒ Status

Returns a new instance of Status.



11
12
13
14
15
16
# File 'lib/rhelm/subcommand/status.rb', line 11

def initialize(release_name, options = {})
  super(options)

  @release_name = release_name
  @help = options[:help]
end

Instance Attribute Details

#helpObject (readonly)

Returns the value of attribute help.



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

def help
  @help
end

#release_nameObject (readonly)

Returns the value of attribute release_name.



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

def release_name
  @release_name
end

Instance Method Details

#cli_argsObject



34
35
36
37
38
39
40
# File 'lib/rhelm/subcommand/status.rb', line 34

def cli_args
  super.tap do |args|
    args << '--help' if help

    args << release_name
  end.flatten
end

#exists?Boolean

Returns:

  • (Boolean)


22
23
24
25
26
27
28
29
30
31
32
# File 'lib/rhelm/subcommand/status.rb', line 22

def exists?
  run(raise_on_error: false) do |lines,status|
    if status == 0
      true
    elsif status == 1 && /Error: release: not found/m.match(lines)
      false
    else
      report_failure(lines, status)
    end
  end
end

#subcommand_nameObject



18
19
20
# File 'lib/rhelm/subcommand/status.rb', line 18

def subcommand_name
  "status"
end