Class: VagrantK8s::KustomizeConfig
- Inherits:
-
Object
- Object
- VagrantK8s::KustomizeConfig
- Defined in:
- lib/vagrant-k8s/kustomize_provisioner.rb
Instance Attribute Summary collapse
-
#force_conflicts ⇒ Object
Returns the value of attribute force_conflicts.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#path ⇒ Object
Returns the value of attribute path.
-
#prune ⇒ Object
Returns the value of attribute prune.
-
#prune_selector ⇒ Object
Returns the value of attribute prune_selector.
-
#server_side ⇒ Object
Returns the value of attribute server_side.
-
#wait ⇒ Object
Returns the value of attribute wait.
Instance Method Summary collapse
- #finalize! ⇒ Object
-
#initialize ⇒ KustomizeConfig
constructor
A new instance of KustomizeConfig.
- #validate(_machine) ⇒ Object
Constructor Details
#initialize ⇒ KustomizeConfig
Returns a new instance of KustomizeConfig.
9 10 11 12 |
# File 'lib/vagrant-k8s/kustomize_provisioner.rb', line 9 def initialize @path = @namespace = @prune_selector = UNSET_VALUE @prune = @server_side = @force_conflicts = @wait = UNSET_VALUE end |
Instance Attribute Details
#force_conflicts ⇒ Object
Returns the value of attribute force_conflicts.
7 8 9 |
# File 'lib/vagrant-k8s/kustomize_provisioner.rb', line 7 def force_conflicts @force_conflicts end |
#namespace ⇒ Object
Returns the value of attribute namespace.
7 8 9 |
# File 'lib/vagrant-k8s/kustomize_provisioner.rb', line 7 def namespace @namespace end |
#path ⇒ Object
Returns the value of attribute path.
7 8 9 |
# File 'lib/vagrant-k8s/kustomize_provisioner.rb', line 7 def path @path end |
#prune ⇒ Object
Returns the value of attribute prune.
7 8 9 |
# File 'lib/vagrant-k8s/kustomize_provisioner.rb', line 7 def prune @prune end |
#prune_selector ⇒ Object
Returns the value of attribute prune_selector.
7 8 9 |
# File 'lib/vagrant-k8s/kustomize_provisioner.rb', line 7 def prune_selector @prune_selector end |
#server_side ⇒ Object
Returns the value of attribute server_side.
7 8 9 |
# File 'lib/vagrant-k8s/kustomize_provisioner.rb', line 7 def server_side @server_side end |
#wait ⇒ Object
Returns the value of attribute wait.
7 8 9 |
# File 'lib/vagrant-k8s/kustomize_provisioner.rb', line 7 def wait @wait end |
Instance Method Details
#finalize! ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/vagrant-k8s/kustomize_provisioner.rb', line 14 def finalize! @namespace = nil if @namespace == UNSET_VALUE @prune_selector = nil if @prune_selector == UNSET_VALUE @prune = false if @prune == UNSET_VALUE @server_side = false if @server_side == UNSET_VALUE @force_conflicts = false if @force_conflicts == UNSET_VALUE @wait = false if @wait == UNSET_VALUE end |
#validate(_machine) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/vagrant-k8s/kustomize_provisioner.rb', line 23 def validate(_machine) errors = [] errors << 'kustomize.path is required' unless @path.is_a?(String) && !@path.empty? if @prune && !Kubeconfig.present?(@prune_selector) errors << 'kustomize.prune_selector is required when prune is true' end { 'vagrant-k8s' => errors } end |