diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-12-10 00:59:04 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-12-10 00:59:04 -0800 |
| commit | 26731694f88dbe28f5e088adaa6436fe7417fc72 (patch) | |
| tree | deca67ab9393e37f306189f50a0e0b596fdb9c2b | |
| parent | 765b3ef1beae5418491e338d397a589186ca4458 (diff) | |
| download | seaweedfs-26731694f88dbe28f5e088adaa6436fe7417fc72.tar.xz seaweedfs-26731694f88dbe28f5e088adaa6436fe7417fc72.zip | |
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
| -rw-r--r-- | weed/s3api/auth_credentials.go | 9 |
1 files 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 } |
