feat: each provider can have its own timeout
providers.azure.timeout, providers.databricks.timeout and providers.repos.timeout override providers.timeout for that provider's requests; --timeout still sets them all. lazysecrets share, which reads a key and repo files, waits the longest of them.
This commit is contained in:
11 files changed
+106
-29
No files matched your search
@@ -123,7 +123,8 @@ type KeyRules struct {
|
||||
}
|
||||
|
||||
type Providers struct {
|
||||
// Timeout bounds each backend request; defaults to 30s.
|
||||
// Timeout bounds each backend request; defaults to 30s. Each
|
||||
// provider's own timeout overrides it for that provider.
|
||||
Timeout time.Duration `yaml:"timeout"`
|
||||
Azure Azure `yaml:"azure"`
|
||||
Databricks Databricks `yaml:"databricks"`
|
||||
@@ -134,6 +135,8 @@ type Providers struct {
|
||||
// that repo is the only one shown; elsewhere, the ones in Paths and under
|
||||
// Roots.
|
||||
type Repos struct {
|
||||
// Timeout overrides providers.timeout for these requests.
|
||||
Timeout time.Duration `yaml:"timeout"`
|
||||
// Enabled defaults to true.
|
||||
Enabled *bool `yaml:"enabled"`
|
||||
Paths []string `yaml:"paths"`
|
||||
@@ -148,6 +151,8 @@ type Repos struct {
|
||||
}
|
||||
|
||||
type Azure struct {
|
||||
// Timeout overrides providers.timeout for these requests.
|
||||
Timeout time.Duration `yaml:"timeout"`
|
||||
// Enabled defaults to true.
|
||||
Enabled *bool `yaml:"enabled"`
|
||||
// HideSubscriptions lists subscriptions to leave out, by name or ID.
|
||||
@@ -158,6 +163,8 @@ type Azure struct {
|
||||
}
|
||||
|
||||
type Databricks struct {
|
||||
// Timeout overrides providers.timeout for these requests.
|
||||
Timeout time.Duration `yaml:"timeout"`
|
||||
// Enabled defaults to true.
|
||||
Enabled *bool `yaml:"enabled"`
|
||||
HideProfiles []string `yaml:"hideProfiles"`
|
||||
|
||||
@@ -29,6 +29,7 @@ storage:
|
||||
providers:
|
||||
timeout: 1m
|
||||
azure:
|
||||
timeout: 2m
|
||||
hideSubscriptions: [platform-mgmt]
|
||||
vaults:
|
||||
- https://kv-foo.vault.azure.net/
|
||||
@@ -40,7 +41,7 @@ providers:
|
||||
t.Fatal(err)
|
||||
}
|
||||
if c.UI.Icons == nil || *c.UI.Icons || c.Values.ClipboardClear == nil || *c.Values.ClipboardClear != 45*time.Second ||
|
||||
c.Providers.Timeout != time.Minute || len(c.Providers.Azure.Vaults) != 1 || c.Providers.Databricks.HideProfiles[0] != "test" {
|
||||
c.Providers.Timeout != time.Minute || c.Providers.Azure.Timeout != 2*time.Minute || len(c.Providers.Azure.Vaults) != 1 || c.Providers.Databricks.HideProfiles[0] != "test" {
|
||||
t.Errorf("config = %+v", c)
|
||||
}
|
||||
if c.UI.SourcesView != "flat" || On(c.Storage.History) || !On(c.Storage.Cache) {
|
||||
|
||||
Reference in new issue
Block a user