Module: KitchenK8s::Helper Private

Included in:
Kitchen::Driver::K8s, Kitchen::Transport::Connection
Defined in:
lib/kitchen/helper/k8s.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.

Since:

  • 1.0



7
8
9
10
11
12
13
14
15
# 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) ⇒ 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



17
18
19
20
21
22
23
24
25
# 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