Module: KitchenKubernetes::Helper Private

Included in:
Kitchen::Driver::Kubernetes, Kitchen::Transport::Kubernetes::Connection
Defined in:
lib/kitchen-kubernetes/helper.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Utility mixin for other classes in this plugin.

Since:

  • 1.0

Instance Method Summary collapse

Instance Method Details

#kube_optionsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Because plugins and connections have different APIs.

Since:

  • 1.0



25
26
27
28
29
30
31
32
33
# File 'lib/kitchen-kubernetes/helper.rb', line 25

def kube_options
  if defined?(config)
    config
  elsif defined?(options)
    options
  else
    raise "Something went wrong, please file a bug"
  end
end

#kubectl_command(*cmd) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 1.0



35
36
37
38
39
40
41
42
43
# File 'lib/kitchen-kubernetes/helper.rb', line 35

def kubectl_command(*cmd)
  out = [kube_options[:kubectl_command]]
  if kube_options[:context]
    out << '--context'
    out << kube_options[:context]
  end
  out.concat(cmd)
  out
end