From 38ab36dded1b4364c5810fa74ae36f815d76ab2f Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sun, 11 Jun 2023 14:20:14 +0200 Subject: [PATCH] Fix: Do not exit 1, just don't provide credentials on get Signed-off-by: Knut Ahlers --- bin/docker-credential-vault | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/docker-credential-vault b/bin/docker-credential-vault index 3921e0e..5dddcba 100755 --- a/bin/docker-credential-vault +++ b/bin/docker-credential-vault @@ -19,7 +19,7 @@ set -euo pipefail config="${HOME}/.config/docker-credential-vault" req_cmds=(jq md5sum vault) -NO_LOG=1 +: ${NO_LOG:=1} PREFIX=secret/docker-credential [[ -f $config ]] && source "${config}" || true @@ -35,7 +35,7 @@ function get() { local hostname="$(cat -s)" # Missing newline at the end, read does not work 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() {