Class: Kitchen::Transport::Connection
- Inherits:
-
Base::Connection
- Object
- Base::Connection
- Kitchen::Transport::Connection
- Includes:
- KitchenK8s::Helper, ShellOut
- Defined in:
- lib/kitchen/transport/k8s.rb
Overview
Connection class for Kitchen
Instance Method Summary collapse
Methods included from KitchenK8s::Helper
#kube_options, #kubectl_command
Instance Method Details
#execute(command) ⇒ Object
33 34 35 36 |
# File 'lib/kitchen/transport/k8s.rb', line 33 def execute(command) return if command.nil? run_command(kubectl_command('exec', '--tty', '--container=default', [:pod_id], '--', *Shellwords.split(wrap_command(command)))) end |
#upload(locals, remote) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/kitchen/transport/k8s.rb', line 39 def upload(locals, remote) return if locals.empty? locals.each do |local| full_remote = "#{options[:namespace]}/#{options[:pod_id]}:#{remote}" run_command(kubectl_command('cp', local, full_remote, '-c', 'default')) end end |