Skip to content

Commit a040cf7

Browse files
committed
s3: do not allow 0s refresh interval after applying defaults
1 parent d289bc8 commit a040cf7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backends/s3/s3.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func (o Options) Check() error {
117117
if !hasSecretsCreds && !hasStaticCreds {
118118
return fmt.Errorf("s3 storage.options: credentials are required, fill either (access_key and secret_key) or (access_key_filename and secret_key_filename)")
119119
}
120-
if d := o.SecretsRefreshInterval; hasSecretsCreds && d != 0 && d < time.Second {
120+
if hasSecretsCreds && o.SecretsRefreshInterval < time.Second {
121121
return fmt.Errorf("s3 storage.options: field refresh_secrets is required when using secret credentials")
122122
}
123123
if o.Bucket == "" {

0 commit comments

Comments
 (0)