fix: ignore bucket-set-acl not implemented error

This commit is contained in:
Qiu Jian
2020-08-03 02:24:47 +08:00
parent 731d86439a
commit 938264a1aa
+7 -1
View File
@@ -17,6 +17,7 @@ package objectstore
import (
"net/url"
"os"
"strings"
"yunion.io/x/jsonutils"
"yunion.io/x/log"
@@ -504,7 +505,12 @@ func (cli *SObjectStoreClient) SetIBucketAcl(name string, cannedAcl cloudprovide
acl := s3cli.CannedAcl(cli.ownerId, cli.ownerName, string(cannedAcl))
err := cli.client.SetBucketAcl(name, acl)
if err != nil {
return errors.Wrap(err, "SetBucketAcl")
if strings.Contains(err.Error(), "not implemented") {
// ignore not implemented error
return nil // cloudprovider.ErrNotImplemented
} else {
return errors.Wrap(err, "SetBucketAcl")
}
}
return nil
}