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:
parent
ebfaa551eb
commit
f832d3da66
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue