From a040cf72e60abb81b01aa7b163677fcef3f4fcb6 Mon Sep 17 00:00:00 2001 From: Rodrigue Geis Date: Tue, 12 Sep 2023 16:09:18 +0200 Subject: [PATCH] s3: do not allow 0s refresh interval after applying defaults --- backends/s3/s3.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/s3/s3.go b/backends/s3/s3.go index d1717da..5ff5c1e 100644 --- a/backends/s3/s3.go +++ b/backends/s3/s3.go @@ -117,7 +117,7 @@ func (o Options) Check() error { if !hasSecretsCreds && !hasStaticCreds { return fmt.Errorf("s3 storage.options: credentials are required, fill either (access_key and secret_key) or (access_key_filename and secret_key_filename)") } - if d := o.SecretsRefreshInterval; hasSecretsCreds && d != 0 && d < time.Second { + if hasSecretsCreds && o.SecretsRefreshInterval < time.Second { return fmt.Errorf("s3 storage.options: field refresh_secrets is required when using secret credentials") } if o.Bucket == "" {