From 26731694f88dbe28f5e088adaa6436fe7417fc72 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 10 Dec 2020 00:59:04 -0800 Subject: [PATCH] s3: use static configuration by default So that users can still use the previous configuration files. If leave it empty, s3 will try to use the version from filer --- weed/s3api/auth_credentials.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/weed/s3api/auth_credentials.go b/weed/s3api/auth_credentials.go index c2ffefedc..da0a38dbf 100644 --- a/weed/s3api/auth_credentials.go +++ b/weed/s3api/auth_credentials.go @@ -38,13 +38,14 @@ func NewIdentityAccessManagement(option *S3ApiServerOption) *IdentityAccessManag iam := &IdentityAccessManagement{ domain: option.DomainName, } - if err := iam.loadS3ApiConfigurationFromFiler(option); err != nil { - glog.Warningf("fail to load config: %v", err) - } - if len(iam.identities) == 0 && option.Config != "" { + if option.Config != "" { if err := iam.loadS3ApiConfigurationFromFile(option.Config); err != nil { glog.Fatalf("fail to load config file %s: %v", option.Config, err) } + } else { + if err := iam.loadS3ApiConfigurationFromFiler(option); err != nil { + glog.Warningf("fail to load config: %v", err) + } } return iam }