diff --git a/CHANGELOG.md b/CHANGELOG.md index f670a97..82abd15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## Unreleased +Bugs: + +* Errors due to replication delay for tokens will now be retried [GH-333](https://github.com/hashicorp/vault-action/pull/333) + ## 2.4.1 (April 28th, 2022) Improvements: diff --git a/src/action.js b/src/action.js index 435f86e..b52bba3 100644 --- a/src/action.js +++ b/src/action.js @@ -26,7 +26,15 @@ async function exportSecrets() { const defaultOptions = { prefixUrl: vaultUrl, headers: {}, - https: {} + https: {}, + retry: { + statusCodes: [ + ...got.defaults.options.retry.statusCodes, + // Vault returns 412 when the token in use hasn't yet been replicated + // to the performance replica queried. See issue #332. + 412, + ] + } } const tlsSkipVerify = (core.getInput('tlsSkipVerify', { required: false }) || 'false').toLowerCase() != 'false';