module KitchenKubernetes::Helper

Utility mixin for other classes in this plugin.

@since 1.0 @api private

Public Instance Methods

kube_options() click to toggle source

Because plugins and connections have different APIs.

# 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) click to toggle source
# 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