Sha256: ca4b057da35638e15da1060e6b5ace3bf41baa27b3cfc85e5bf697373cf15f89

Contents?: true

Size: 663 Bytes

Versions: 6

Compression:

Stored size: 663 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"

    requires_current_master
    requires_current_account_token

    def execute
      args = ["--current"]
      args << "--force" if self.force?
      args << "--cloud-master-id #{self.cloud_master_id}" if self.cloud_master_id
      Kontena.run("cloud master add #{args.map(&:shellescape).join(' ')}")
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
kontena-cli-0.16.0 lib/kontena/cli/master/init_cloud_command.rb
kontena-cli-0.16.0.rc3 lib/kontena/cli/master/init_cloud_command.rb
kontena-cli-0.16.0.rc2 lib/kontena/cli/master/init_cloud_command.rb
kontena-cli-0.16.0.rc1 lib/kontena/cli/master/init_cloud_command.rb
kontena-cli-0.16.0.pre9 lib/kontena/cli/master/init_cloud_command.rb
kontena-cli-0.16.0.pre8 lib/kontena/cli/master/init_cloud_command.rb