Class: Cuber::Commands::Logs

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/cuber/commands/logs.rb

Instance Method Summary collapse

Methods included from Utils

#kubectl, #kubeget, #render

Constructor Details

#initialize(options) ⇒ Logs

Returns a new instance of Logs.



5
6
7
# File 'lib/cuber/commands/logs.rb', line 5

def initialize options
  @options = options
end

Instance Method Details

#executeObject



9
10
11
12
13
14
15
# File 'lib/cuber/commands/logs.rb', line 9

def execute
  pod = ARGV.first
  cmd = ['logs']
  cmd += pod ? [pod] : ['-l', "app.kubernetes.io/name=#{@options[:app]}"]
  cmd += ['--all-containers']
  kubectl *cmd
end