module Commands::Wtf

Public Instance Methods

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

  command = if container_id
              "logs -p #{pod_id} -n #{environment_name} -c #{container_id}"
            else
              "logs -p #{pod_id} -n #{environment_name}"
            end

  Kernel.exec(
    "#{KUBECTL} --context=#{Services::Kube.current_profile} #{command}"
  )
end