Class: Kubes::CLI::Base
- Inherits:
-
Object
- Object
- Kubes::CLI::Base
- Includes:
- Logging
- Defined in:
- lib/kubes/cli/base.rb
Direct Known Subclasses
Apply, Build, Clean, Compile, Delete, Deploy, Describe, Exec, Get, Logs, Prune
Instance Method Summary collapse
- #compile ⇒ Object
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
- #pod_name ⇒ Object
Methods included from Logging
Constructor Details
#initialize(options = {}) ⇒ Base
Returns a new instance of Base.
5 6 7 |
# File 'lib/kubes/cli/base.rb', line 5 def initialize(={}) @options = end |
Instance Method Details
#compile ⇒ Object
9 10 11 |
# File 'lib/kubes/cli/base.rb', line 9 def compile Compile.new(@options).run unless @options[:compile] == false end |
#pod_name ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/kubes/cli/base.rb', line 13 def pod_name return unless @options[:pod] pods = Kubes::Kubectl::Fetch::Pods.new(@options) items = pods.fetch(:pod) = items.map { |i| i['metadata'] } .select! { |i| i['name'].include?(@options[:pod]) } = .sort { i['creationTimestamp'] }.last ['name'] if end |