Retry on 412 status codes (#333)

* Retry on 412 status codes
* Add retry tests
This commit is contained in:
Tom Proctor
2022-06-29 12:55:26 +01:00
committed by GitHub
parent ad04ab9377
commit 55a11671e0
6 changed files with 956 additions and 2 deletions

View File

@@ -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';