module KitchenK8s::Helper

Utility mixin for other classes in this plugin.

@since 1.0 @api private

Public Instance Methods

kube_options() click to toggle source
# File lib/kitchen/helper/k8s.rb, line 7
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/helper/k8s.rb, line 17
def kubectl_command(*cmd)
  out = [kube_options[:binary]]
  if kube_options[:context]
    out << '--context'
    out << kube_options[:context]
  end
  out.concat(cmd)
  out
end