Sha256: 9f23d9847caaad0a444925d8c4bc1115e9a1b3368c49a8085e15ddb6afd4993c

Contents?: true

Size: 721 Bytes

Versions: 53

Compression:

Stored size: 721 Bytes

Contents

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

    parameter 'NAME', 'Secret name'
    parameter '[VALUE]', 'Secret value (default: STDIN)'

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

    requires_current_master

    def default_value
      stdin_input("Enter value for secret '#{name}'", :mask)
    end

    def execute
      vspinner "Updating #{name.colorize(:cyan)} value in the vault " do
        client.put("secrets/#{current_grid}/#{name}", {name: name, value: value, upsert: upsert? })
      end
    end
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
kontena-cli-1.4.3 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.4.3.rc1 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.4.2 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.4.2.rc1 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.4.2.pre1 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.4.1 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.4.1.rc1 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.4.1.pre1 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.3.5 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.3.5.rc1 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.4.0 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.4.0.rc2 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.4.0.rc1 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.4.0.pre14 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.4.0.pre13 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.4.0.pre12 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.4.0.pre11 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.4.0.pre10 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.4.0.pre9 lib/kontena/cli/vault/update_command.rb
kontena-cli-1.4.0.pre8 lib/kontena/cli/vault/update_command.rb