Class: Kontena::Callbacks::ListAndSelectGrid

Inherits:
Kontena::Callback show all
Defined in:
lib/kontena/callbacks/auth/01_list_and_select_grid_after_master_auth.rb

Instance Attribute Summary

Attributes inherited from Kontena::Callback

#command

Instance Method Summary collapse

Methods inherited from Kontena::Callback

callbacks, #initialize, matches_commands, run_callbacks

Constructor Details

This class inherits a constructor from Kontena::Callback

Instance Method Details

#afterObject

Runs kontena grids list –use which will auto join the first available grid



15
16
17
18
19
20
21
22
23
# File 'lib/kontena/callbacks/auth/01_list_and_select_grid_after_master_auth.rb', line 15

def after
  extend Kontena::Cli::Common
  return if command.skip_grid_auto_select?
  return unless current_master
  return unless command.exit_code == 0
  return unless current_master.grid.nil?

  Kontena.run(%w(grid list --use --verbose))
end

#after_loadObject



7
8
9
10
11
# File 'lib/kontena/callbacks/auth/01_list_and_select_grid_after_master_auth.rb', line 7

def after_load
  command.class_eval do
    option ['--skip-grid-auto-select'], :flag, 'Do not auto select grid'
  end
end