Class: Kontena::Callbacks::ConfigureAuthProviderAfterDeploy
- Inherits:
-
Kontena::Callback
- Object
- Kontena::Callback
- Kontena::Callbacks::ConfigureAuthProviderAfterDeploy
- Includes:
- Kontena::Cli::Common
- Defined in:
- lib/kontena/callbacks/master/deploy/60_configure_auth_provider_after_deploy.rb
Instance Attribute Summary
Attributes inherited from Kontena::Callback
Instance Method Summary collapse
Methods included from Kontena::Cli::Common
#access_token=, #add_master, #any_key_to_continue, #any_key_to_continue_with_timeout, #api_url, #api_url=, #api_url_version, #ask, #clear_current_grid, #client, #cloud_auth?, #cloud_client, #config, #confirm, #confirm_command, #current_account, #current_grid, #current_grid=, #current_master, #current_master=, #current_master_index, #display_account_login_info, #display_login_info, #display_logo, #display_master_login_info, #error, #exit_with_error, #kontena_account, #logger, #pastel, #print, #prompt, #puts, #require_api_url, #require_current_account, #require_current_grid, #require_current_master, #require_token, #reset_client, #reset_cloud_client, #running_silent?, #running_verbose?, #settings, #settings_filename, #spinner, #sprint, #sputs, #use_refresh_token, #vfakespinner, #vputs, #vspinner, #warning, #yes?
Methods inherited from Kontena::Callback
callbacks, #initialize, matches_commands, run_callbacks
Constructor Details
This class inherits a constructor from Kontena::Callback
Instance Method Details
#after ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/kontena/callbacks/master/deploy/60_configure_auth_provider_after_deploy.rb', line 22 def after return unless command.exit_code == 0 return unless command.result.kind_of?(Hash) return unless command.result.has_key?(:name) return unless config.current_master return unless config.current_master.name == command.result[:name] if command.respond_to?(:skip_auth_provider?) && command.skip_auth_provider? return end configure_auth_provider end |
#configure_auth_provider ⇒ Object
18 19 20 |
# File 'lib/kontena/callbacks/master/deploy/60_configure_auth_provider_after_deploy.rb', line 18 def configure_auth_provider Kontena.run("master init-cloud #{init_cloud_args}") end |
#init_cloud_args ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/kontena/callbacks/master/deploy/60_configure_auth_provider_after_deploy.rb', line 9 def init_cloud_args args = [] args << '--force' args << "--cloud-master-id #{command.cloud_master_id}" if command.cloud_master_id args << "--provider #{command.result[:provider]}" if command.result[:provider] args << "--version #{command.result[:version]}" if command.result[:version] args.join(' ') end |