mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
Turn off retries on CLI (#4918)
For the CLI it just ends up confusing people as to why it's "hanging" before returning a 500. This can still be overridden with VAULT_MAX_RETRIES.
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"regexp"
|
||||
"strings"
|
||||
"sync"
|
||||
@@ -88,6 +89,11 @@ func (c *BaseCommand) Client() (*api.Client, error) {
|
||||
return nil, errors.Wrap(err, "failed to create client")
|
||||
}
|
||||
|
||||
// Turn off retries on the CLI
|
||||
if os.Getenv(api.EnvVaultMaxRetries) == "" {
|
||||
client.SetMaxRetries(0)
|
||||
}
|
||||
|
||||
// Set the wrapping function
|
||||
client.SetWrappingLookupFunc(c.DefaultWrappingLookupFunc)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user