Class: KBE::CLI::EnterCommand

Inherits:
Clamp::Command
  • Object
show all
Defined in:
lib/kbe/cli/enter_command.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/kbe/cli/enter_command.rb', line 19

def execute
  cmd_list = ["sh"] unless cmd_list
  pod = KBE.pod_by selector_or_pod

  args = []
  args << "exec -it #{pod}"
  unless container == :first
    args << "-c #{container}"
  end
  args << cmd_list.join(" ")

  KBE.kubectl args
end