Class: Cloud::Sh::Commands::K8sTail
- Inherits:
-
Base
- Object
- Base
- Cloud::Sh::Commands::K8sTail
show all
- Defined in:
- lib/cloud/sh/commands/k8s_tail.rb
Instance Attribute Summary
Attributes inherited from Base
#args, #options
Instance Method Summary
collapse
Methods inherited from Base
#config, execute, #initialize
#command_chain
Instance Method Details
#command ⇒ Object
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/cloud/sh/commands/k8s_tail.rb', line 15
def command
[
exe,
"^" + (options[:pod] == "all" ? "." : options[:pod]),
"--context #{options[:context]}",
"--namespace #{options[:namespace]}",
"--regex",
"--tail #{options[:tail]}",
"--since 240h",
"--colored-output pod",
"--follow true"
].join(" ")
end
|
#exe ⇒ Object
29
30
31
|
# File 'lib/cloud/sh/commands/k8s_tail.rb', line 29
def exe
File.expand_path("../../../../exe/kubetail", __dir__)
end
|
#execute ⇒ Object
9
10
11
12
13
|
# File 'lib/cloud/sh/commands/k8s_tail.rb', line 9
def execute
puts "Command: #{command}"
puts "Env: #{env.inspect}\n"
exec env, command
end
|