module Commands::Ssh

Public Instance Methods

ssh( container_id, environment_name = Services::AppConfig.get_or_exit('environment') ) click to toggle source
# File lib/busbar_cli/commands/ssh.rb, line 9
def ssh(
  container_id,
  environment_name = Services::AppConfig.get_or_exit('environment')
)
  Services::Kube.configure_temporary_profile(options.profile)

  lines   = `tput lines`.chomp
  columns = `tput cols`.chomp

  Kernel.exec(
    "#{KUBECTL} --context=#{Services::Kube.current_profile} exec #{container_id} -n  " \
    "#{environment_name} -i -t -- " \
    "/usr/bin/env LINES=#{lines} COLUMNS=#{columns} TERM=#{ENV['TERM']} /bin/bash -l"
  )
end