Sha256: 6b7a1aa1b1684d0981e3852b76effcc8bf6debf2e367a0666eadac406ed56f31

Contents?: true

Size: 708 Bytes

Versions: 28

Compression:

Stored size: 708 Bytes

Contents

require_relative '../services_helper'

module Kontena::Cli::Services::Secrets
  class LinkCommand < Clamp::Command
    include Kontena::Cli::Common
    include Kontena::Cli::GridOptions
    include Kontena::Cli::Services::ServicesHelper

    parameter "NAME", "Service name"
    parameter "SECRET", "Secret to be added from Vault (format: secret:name:type)"

    def execute
      require_api_url
      token = require_token
      result = client(token).get("services/#{parse_service_id(name)}")
      secrets = result['secrets']
      secrets << parse_secrets([secret])[0]
      data = {
        secrets: secrets
      }
      client(token).put("services/#{parse_service_id(name)}", data)
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
kontena-cli-0.15.5 lib/kontena/cli/services/secrets/link_command.rb
kontena-cli-0.15.5.rc2 lib/kontena/cli/services/secrets/link_command.rb
kontena-cli-0.15.5.rc1 lib/kontena/cli/services/secrets/link_command.rb
kontena-cli-0.15.4 lib/kontena/cli/services/secrets/link_command.rb
kontena-cli-0.15.4.rc2 lib/kontena/cli/services/secrets/link_command.rb
kontena-cli-0.15.4.rc1 lib/kontena/cli/services/secrets/link_command.rb
kontena-cli-0.15.4.pre1 lib/kontena/cli/services/secrets/link_command.rb
kontena-cli-0.15.3 lib/kontena/cli/services/secrets/link_command.rb
kontena-cli-0.15.2 lib/kontena/cli/services/secrets/link_command.rb
kontena-cli-0.15.1 lib/kontena/cli/services/secrets/link_command.rb
kontena-cli-0.15.0 lib/kontena/cli/services/secrets/link_command.rb
kontena-cli-0.15.0.rc3 lib/kontena/cli/services/secrets/link_command.rb
kontena-cli-0.15.0.rc2 lib/kontena/cli/services/secrets/link_command.rb
kontena-cli-0.15.0.rc1 lib/kontena/cli/services/secrets/link_command.rb
kontena-cli-0.14.7 lib/kontena/cli/services/secrets/link_command.rb
kontena-cli-0.14.6 lib/kontena/cli/services/secrets/link_command.rb
kontena-cli-0.14.5 lib/kontena/cli/services/secrets/link_command.rb
kontena-cli-0.14.4 lib/kontena/cli/services/secrets/link_command.rb
kontena-cli-0.14.3 lib/kontena/cli/services/secrets/link_command.rb
kontena-cli-0.14.2 lib/kontena/cli/services/secrets/link_command.rb