Sha256: 11da8d76089bccaed8f88edf93b8c1b81783f81808a0afc3198190ed7bceeaba

Contents?: true

Size: 712 Bytes

Versions: 20

Compression:

Stored size: 712 Bytes

Contents

module Kontena::Cli::Vault
  class UpdateCommand < Kontena::Command
    include Kontena::Cli::Common

    parameter 'NAME', 'Secret name'
    parameter '[VALUE]', 'Secret value'

    option ['-u', '--upsert'], :flag, 'Create secret unless already exists', default: false
    option '--silent', :flag, "Reduce output verbosity"

    def execute
      require_api_url
      require_current_grid

      token = require_token
      value ||= STDIN.read.chomp
      data = {
        name: name,
        value: value,
        upsert: upsert?
      }
      vspinner "Updating #{name.colorize(:cyan)} value in the vault " do
        client(token).put("secrets/#{current_grid}/#{name}", data)
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
kontena-cli-1.2.0.pre3 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.2.0.pre2 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.1.6 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.2.0.pre1 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.1.5 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.1.5.rc3 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.1.5.rc2 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.1.5.rc1 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.1.4 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.2.0.dev1 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.1.3 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.1.2 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.1.2.rc2 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.1.2.rc1 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.1.1 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.1.1.rc1 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.1.0 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.1.0.rc2 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.1.0.rc1 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.1.0.pre1 lib/kontena/cli/vault/update_command.rb