Class: Seira::NodePools
- Inherits:
-
Object
- Object
- Seira::NodePools
- Includes:
- Commands
- Defined in:
- lib/seira/node_pools.rb
Constant Summary collapse
- VALID_ACTIONS =
%w[help list list-nodes add cordon drain delete].freeze
- SUMMARY =
"For managing node pools for a cluster.".freeze
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
Instance Method Summary collapse
-
#initialize(action:, args:, context:, settings:) ⇒ NodePools
constructor
A new instance of NodePools.
- #run ⇒ Object
Methods included from Commands
#gcloud, gcloud, kubectl, #kubectl, #tsh, tsh
Constructor Details
#initialize(action:, args:, context:, settings:) ⇒ NodePools
Returns a new instance of NodePools.
15 16 17 18 19 20 |
# File 'lib/seira/node_pools.rb', line 15 def initialize(action:, args:, context:, settings:) @action = action @args = args @context = context @settings = settings end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
13 14 15 |
# File 'lib/seira/node_pools.rb', line 13 def action @action end |
#args ⇒ Object (readonly)
Returns the value of attribute args.
13 14 15 |
# File 'lib/seira/node_pools.rb', line 13 def args @args end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
13 14 15 |
# File 'lib/seira/node_pools.rb', line 13 def context @context end |
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
13 14 15 |
# File 'lib/seira/node_pools.rb', line 13 def settings @settings end |
Instance Method Details
#run ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/seira/node_pools.rb', line 22 def run case action when 'help' run_help when 'list' run_list when 'list-nodes' run_list_nodes when 'add' run_add when 'cordon' run_cordon when 'drain' run_drain when 'delete' run_delete else fail "Unknown command encountered" end end |