OCI: Don't store region in the backend struct (#10248)

* OCI: Don't store region in the backend struct

* Update physical/oci/oci.go

Co-authored-by: Calvin Leung Huang <cleung2010@gmail.com>

Co-authored-by: Calvin Leung Huang <cleung2010@gmail.com>
This commit is contained in:
Vishal Nayak 2020-10-26 19:41:51 -04:00 committed by GitHub
parent ebfaa551eb
commit f832d3da66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions

View File

@ -63,7 +63,6 @@ var (
type Backend struct {
client *objectstorage.ObjectStorageClient
region string
bucketName string
logger log.Logger
permitPool *physical.PermitPool
@ -73,9 +72,7 @@ type Backend struct {
}
func NewBackend(conf map[string]string, logger log.Logger) (physical.Backend, error) {
region := conf["region"]
bucketName := conf["bucket_name"]
if bucketName == "" {
return nil, errors.New("missing bucket name")
}
@ -127,9 +124,10 @@ func NewBackend(conf map[string]string, logger log.Logger) (physical.Backend, er
return nil, errwrap.Wrapf("failed creating NewObjectStorageClientWithConfigurationProvider: {{err}}", err)
}
region := conf["region"]
if region != "" {
objectStorageClient.SetRegion(region)
}
}
logger.Debug("configuration",
"bucket_name", bucketName,
@ -142,7 +140,6 @@ func NewBackend(conf map[string]string, logger log.Logger) (physical.Backend, er
return &Backend{
client: &objectStorageClient,
region: region,
bucketName: bucketName,
logger: logger,
permitPool: physical.NewPermitPool(MaxNumberOfPermits),