Merge pull request 'fix: tech-debt: tools/vault-import.sh uses hardcoded secret/ KV mount (#910)' (#932) from fix/issue-910 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
This commit is contained in:
commit
c3e58e88ed
1 changed files with 5 additions and 5 deletions
|
|
@ -151,9 +151,9 @@ _kv_put_secret() {
|
||||||
-X POST \
|
-X POST \
|
||||||
-d "$payload" \
|
-d "$payload" \
|
||||||
-o "$tmpfile" \
|
-o "$tmpfile" \
|
||||||
"${VAULT_ADDR}/v1/kv/data/${path}")" || {
|
"${VAULT_ADDR}/v1/${VAULT_KV_MOUNT:-kv}/data/${path}")" || {
|
||||||
rm -f "$tmpfile"
|
rm -f "$tmpfile"
|
||||||
_err "Failed to write to Vault at kv/data/${path}: curl error"
|
_err "Failed to write to Vault at ${VAULT_KV_MOUNT:-kv}/data/${path}: curl error"
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
rm -f "$tmpfile"
|
rm -f "$tmpfile"
|
||||||
|
|
@ -164,15 +164,15 @@ _kv_put_secret() {
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
404)
|
404)
|
||||||
_err "KV path not found: kv/data/${path}"
|
_err "KV path not found: ${VAULT_KV_MOUNT:-kv}/data/${path}"
|
||||||
return 1
|
return 1
|
||||||
;;
|
;;
|
||||||
403)
|
403)
|
||||||
_err "Permission denied writing to kv/data/${path}"
|
_err "Permission denied writing to ${VAULT_KV_MOUNT:-kv}/data/${path}"
|
||||||
return 1
|
return 1
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
_err "Failed to write to Vault at kv/data/${path}: HTTP $http_code"
|
_err "Failed to write to Vault at ${VAULT_KV_MOUNT:-kv}/data/${path}: HTTP $http_code"
|
||||||
return 1
|
return 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue