Class: Rhelm::Subcommand::Lint

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

Overview

Helm lint subcommand: ‘helm lint PATH [flags]`. docs: helm.sh/docs/helm/helm_lint/

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(path, options = {}) ⇒ Lint

Returns a new instance of Lint.



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/rhelm/subcommand/lint.rb', line 16

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

  @path = path
  @set = options[:set]
  @set_file = options[:set_file]
  @set_string = options[:set_string]
  @strict = options[:strict]
  @values = options[:values]
  @with_subcharts = options[:with_subcharts]
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



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

def path
  @path
end

#setObject (readonly)

Returns the value of attribute set.



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

def set
  @set
end

#set_fileObject (readonly)

Returns the value of attribute set_file.



8
9
10
# File 'lib/rhelm/subcommand/lint.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/lint.rb', line 8

def set_string
  @set_string
end

#strictObject (readonly)

Returns the value of attribute strict.



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

def strict
  @strict
end

#valuesObject (readonly)

Returns the value of attribute values.



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

def values
  @values
end

#with_subchartsObject (readonly)

Returns the value of attribute with_subcharts.



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

def with_subcharts
  @with_subcharts
end

Instance Method Details

#cli_argsObject



32
33
34
35
36
37
38
39
40
41
42
43
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
# File 'lib/rhelm/subcommand/lint.rb', line 32

def cli_args
  super.tap do |args|
    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

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

    args << '--with-subcharts' if with_subcharts
    args << '--strict' if strict

    args << path
  end.flatten
end

#subcommand_nameObject



28
29
30
# File 'lib/rhelm/subcommand/lint.rb', line 28

def subcommand_name
  'lint'
end