module Commands::Exec

Public Instance Methods

exec(pod, environment, command, *command_params) click to toggle source
# File lib/busbar_cli/commands/exec.rb, line 11
def exec(pod, environment, command, *command_params)
  Services::Kube.configure_temporary_profile(options.profile)

  command = "#{command} #{command_params.join(' ')}" if command_params.count.positive?

  Kernel.exec(
    "#{KUBECTL} --namespace #{environment} --context=#{Services::Kube.current_profile} " \
    "exec -ti #{pod} #{command}"
  )
end