Sha256: 09e6ff666bcd864ec7e98411b8019fd59a97be2c0290b5703d79cddb85a25610

Contents?: true

Size: 979 Bytes

Versions: 25

Compression:

Stored size: 979 Bytes

Contents

module Kontena::Cli::Master
  class InitCloudCommand < Kontena::Command

    include Kontena::Cli::Common

    banner "Configures the current Kontena Master to use Kontena Cloud services and authentication"

    option '--force',           :flag,       "Don't ask questions"
    option '--cloud-master-id', '[ID]',      "Use existing cloud master ID"
    option '--provider',        '[NAME]',    "Set master provider name"
    option '--version',         '[VERSION]', "Set master version"

    requires_current_master
    requires_current_master_token
    requires_current_account_token

    def execute
      args = ["--current"]
      args << "--force" if self.force?
      args += ["--cloud-master-id", self.cloud_master_id.shellescape] if self.cloud_master_id
      args += ["--provider", self.provider.shellescape] if self.provider
      args += ["--version", self.version.shellescape] if self.version
      Kontena.run!(['cloud', 'master', 'add'] + args)
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
kontena-cli-1.3.5 lib/kontena/cli/master/init_cloud_command.rb
kontena-cli-1.3.5.rc1 lib/kontena/cli/master/init_cloud_command.rb
kontena-cli-1.4.0.pre6 lib/kontena/cli/master/init_cloud_command.rb
kontena-cli-1.4.0.pre5 lib/kontena/cli/master/init_cloud_command.rb
kontena-cli-1.4.0.pre4 lib/kontena/cli/master/init_cloud_command.rb
kontena-cli-1.4.0.pre3 lib/kontena/cli/master/init_cloud_command.rb
kontena-cli-1.4.0.pre2 lib/kontena/cli/master/init_cloud_command.rb
kontena-cli-1.4.0.pre1 lib/kontena/cli/master/init_cloud_command.rb
kontena-cli-1.3.4 lib/kontena/cli/master/init_cloud_command.rb
kontena-cli-1.3.4.rc1 lib/kontena/cli/master/init_cloud_command.rb
kontena-cli-1.3.3 lib/kontena/cli/master/init_cloud_command.rb
kontena-cli-1.3.3.rc1 lib/kontena/cli/master/init_cloud_command.rb
kontena-cli-1.3.2 lib/kontena/cli/master/init_cloud_command.rb
kontena-cli-1.3.2.rc2 lib/kontena/cli/master/init_cloud_command.rb
kontena-cli-1.3.2.rc1 lib/kontena/cli/master/init_cloud_command.rb
kontena-cli-1.3.1 lib/kontena/cli/master/init_cloud_command.rb
kontena-cli-1.3.1.rc2 lib/kontena/cli/master/init_cloud_command.rb
kontena-cli-1.3.1.rc1 lib/kontena/cli/master/init_cloud_command.rb
kontena-cli-1.3.0 lib/kontena/cli/master/init_cloud_command.rb
kontena-cli-1.3.0.rc4 lib/kontena/cli/master/init_cloud_command.rb