Class: VagrantK8s::HelmConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-k8s/helm_provisioner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHelmConfig

Returns a new instance of HelmConfig.



11
12
13
14
15
16
# File 'lib/vagrant-k8s/helm_provisioner.rb', line 11

def initialize
  @release = @chart = UNSET_VALUE
  @repo = @version = @namespace = UNSET_VALUE
  @values = @set = UNSET_VALUE
  @wait = @atomic = @create_namespace = @timeout = @helm = UNSET_VALUE
end

Instance Attribute Details

#atomicObject

Returns the value of attribute atomic.



8
9
10
# File 'lib/vagrant-k8s/helm_provisioner.rb', line 8

def atomic
  @atomic
end

#chartObject

Returns the value of attribute chart.



8
9
10
# File 'lib/vagrant-k8s/helm_provisioner.rb', line 8

def chart
  @chart
end

#create_namespaceObject

Returns the value of attribute create_namespace.



8
9
10
# File 'lib/vagrant-k8s/helm_provisioner.rb', line 8

def create_namespace
  @create_namespace
end

#helmObject

Returns the value of attribute helm.



8
9
10
# File 'lib/vagrant-k8s/helm_provisioner.rb', line 8

def helm
  @helm
end

#namespaceObject

Returns the value of attribute namespace.



8
9
10
# File 'lib/vagrant-k8s/helm_provisioner.rb', line 8

def namespace
  @namespace
end

#releaseObject

Returns the value of attribute release.



8
9
10
# File 'lib/vagrant-k8s/helm_provisioner.rb', line 8

def release
  @release
end

#repoObject

Returns the value of attribute repo.



8
9
10
# File 'lib/vagrant-k8s/helm_provisioner.rb', line 8

def repo
  @repo
end

#setObject

Returns the value of attribute set.



8
9
10
# File 'lib/vagrant-k8s/helm_provisioner.rb', line 8

def set
  @set
end

#timeoutObject

Returns the value of attribute timeout.



8
9
10
# File 'lib/vagrant-k8s/helm_provisioner.rb', line 8

def timeout
  @timeout
end

#valuesObject

Returns the value of attribute values.



8
9
10
# File 'lib/vagrant-k8s/helm_provisioner.rb', line 8

def values
  @values
end

#versionObject

Returns the value of attribute version.



8
9
10
# File 'lib/vagrant-k8s/helm_provisioner.rb', line 8

def version
  @version
end

#waitObject

Returns the value of attribute wait.



8
9
10
# File 'lib/vagrant-k8s/helm_provisioner.rb', line 8

def wait
  @wait
end

Instance Method Details

#finalize!Object



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/vagrant-k8s/helm_provisioner.rb', line 18

def finalize!
  @repo = nil if @repo == UNSET_VALUE
  @version = nil if @version == UNSET_VALUE
  @namespace = nil if @namespace == UNSET_VALUE
  @values = [] if @values == UNSET_VALUE
  @set = {} if @set == UNSET_VALUE
  @wait = false if @wait == UNSET_VALUE
  @atomic = false if @atomic == UNSET_VALUE
  @create_namespace = false if @create_namespace == UNSET_VALUE
  @timeout = nil if @timeout == UNSET_VALUE
  @helm = 'helm' if @helm == UNSET_VALUE
end

#validate(_machine) ⇒ Object



31
32
33
34
35
36
37
38
# File 'lib/vagrant-k8s/helm_provisioner.rb', line 31

def validate(_machine)
  errors = []
  errors << 'helm.release is required' unless @release.is_a?(String) && !@release.empty?
  errors << 'helm.chart is required' unless @chart.is_a?(String) && !@chart.empty?
  errors << 'helm.values must be an array' unless @values.is_a?(Array)
  errors << 'helm.set must be a hash' unless @set.is_a?(Hash)
  { 'vagrant-k8s' => errors }
end