Fix: Do not exit 1, just don't provide credentials on get
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
71d5db1c0a
commit
38ab36dded
1 changed files with 2 additions and 2 deletions
|
@ -19,7 +19,7 @@ set -euo pipefail
|
||||||
config="${HOME}/.config/docker-credential-vault"
|
config="${HOME}/.config/docker-credential-vault"
|
||||||
req_cmds=(jq md5sum vault)
|
req_cmds=(jq md5sum vault)
|
||||||
|
|
||||||
NO_LOG=1
|
: ${NO_LOG:=1}
|
||||||
PREFIX=secret/docker-credential
|
PREFIX=secret/docker-credential
|
||||||
|
|
||||||
[[ -f $config ]] && source "${config}" || true
|
[[ -f $config ]] && source "${config}" || true
|
||||||
|
@ -35,7 +35,7 @@ function get() {
|
||||||
local hostname="$(cat -s)" # Missing newline at the end, read does not work
|
local hostname="$(cat -s)" # Missing newline at the end, read does not work
|
||||||
|
|
||||||
log "Retrieving credential for ${hostname} if exists..."
|
log "Retrieving credential for ${hostname} if exists..."
|
||||||
vault read -field=data -format=json "${PREFIX}/$(hash_hostname "${hostname}")"
|
vault read -field=data -format=json "${PREFIX}/$(hash_hostname "${hostname}")" 2>/dev/null || echo "{}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function erase() {
|
function erase() {
|
||||||
|
|
Loading…
Reference in a new issue