File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed
packages/manager/modules/pci/src/projects/project/storages/containers Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change 11import find from 'lodash/find' ;
22
3- import { STORAGE_GATEWAY } from './containers.constants' ;
4-
53export default class Container {
64 constructor ( resource ) {
75 this . publicUrl = null ;
@@ -11,8 +9,4 @@ export default class Container {
119 getObjectById ( objectId ) {
1210 return find ( this . objects , { name : objectId } ) ;
1311 }
14-
15- get storageGateway ( ) {
16- return STORAGE_GATEWAY . replace ( 'REGION' , this . region . toLowerCase ( ) ) ;
17- }
1812}
Original file line number Diff line number Diff line change @@ -35,7 +35,11 @@ export const CONTAINER_DEFAULT_PASSWORD = [
3535 CONTAINER_DEFAULT_PASSWORD_PASSWORD ,
3636] . join ( '.' ) ;
3737
38- export const STORAGE_GATEWAY = 'gateways.storage.REGION.cloud.ovh.net' ;
38+ export const STORAGE_GATEWAY = {
39+ CA : 'gateways.storage.REGION.cloud.ovh.net' ,
40+ EU : 'gateways.storage.REGION.cloud.ovh.net' ,
41+ US : 'gateways.storage.REGION.cloud.ovh.us' ,
42+ } ;
3943
4044export const X_CONTAINER_HEADERS_REGEX = / ^ ( X - C o n t a i n e r | X - S t o r a g e ) / i;
4145
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import {
1616 OBJECT_CONTAINER_TYPE_STATIC ,
1717 OBJECT_CONTAINER_TYPE_PUBLIC ,
1818 OBJECT_TYPE_SEALED ,
19+ STORAGE_GATEWAY ,
1920 X_AUTH_TOKEN ,
2021 X_CONTAINER_HEADERS_REGEX ,
2122 X_CONTAINER_READ ,
@@ -27,11 +28,13 @@ export default class PciStoragesContainersService {
2728 constructor (
2829 $http ,
2930 $q ,
31+ coreConfig ,
3032 OvhApiCloudProjectStorage ,
3133 OvhApiCloudProjectUser ,
3234 ) {
3335 this . $http = $http ;
3436 this . $q = $q ;
37+ this . coreConfig = coreConfig ;
3538 this . OvhApiCloudProjectStorage = OvhApiCloudProjectStorage ;
3639 this . OvhApiCloudProjectUser = OvhApiCloudProjectUser ;
3740 }
@@ -152,6 +155,10 @@ export default class PciStoragesContainersService {
152155 objects : map ( container . objects , object => new ContainerObject ( object ) ) ,
153156 id : containerId ,
154157 publicUrl,
158+ storageGateway : STORAGE_GATEWAY [ this . coreConfig . getRegion ( ) ] . replace (
159+ 'REGION' ,
160+ container . region . toLowerCase ( ) ,
161+ ) ,
155162 } ) ) ;
156163 }
157164
You can’t perform that action at this time.
0 commit comments