Class: Kitchen::Transport::Connection
- Inherits:
-
Base::Connection
- Object
- Base::Connection
- Kitchen::Transport::Connection
show all
- Includes:
- KitchenK8s::Helper, ShellOut
- Defined in:
- lib/kitchen/transport/k8s.rb
Overview
Connection class for Kitchen
Instance Method Summary
collapse
#kube_options, #kubectl_command
Instance Method Details
#execute(command) ⇒ Object
32
33
34
35
|
# File 'lib/kitchen/transport/k8s.rb', line 32
def execute(command)
return if command.nil?
run_command(kubectl_command('exec', '--tty', '--container=default', options[:pod_id], '--', *Shellwords.split(command)))
end
|
#login_command ⇒ Object
47
48
49
|
# File 'lib/kitchen/transport/k8s.rb', line 47
def login_command
info('in login')
end
|
#upload(locals, remote) ⇒ Object
38
39
40
41
42
43
44
|
# File 'lib/kitchen/transport/k8s.rb', line 38
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
|