Skip to content

Commit 3b7669a

Browse files
committed
refactor: env ceph region variable
1 parent f879e0b commit 3b7669a

2 files changed

Lines changed: 10 additions & 18 deletions

File tree

apps/aurora-portal/.env.example

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ IDENTITY_ENDPOINT="http://localhost:8080/identity/v3/"
22
DEFAULT_ENDPOINT_INTERFACE="public"
33
PORT="4001"
44
CEPH_S3_ENDPOINT="https://rgw.example.com"
5-
CEPH_REGION="default"
5+
# Ceph region identifier for AWS Signature V4 signing and LocationConstraint
6+
# SAP Converged Cloud examples:
7+
# - Standard regions: ceph-objectstore-st1 + {region}
8+
# For other Ceph deployments, use your custom region identifier
9+
CEPH_REGION="ceph-objectstore-ec-st1-qa-de-1"
610
IMAGE_METADATA_EXCLUDED_PROPERTIES="name,tags,visibility,protected,min_disk,min_ram,id,status,size,checksum,created_at,updated_at,created-at,updated-at,disk_format,container_format,file,schema,locations,self,direct_url,owner,virtual_size,kernel_id,ramdisk_id,os_hash_algo,os_hash_value,os-hash-algo,os-hash-value,stores,owner_specified.openstack.md5,owner_specified.openstack.sha256,owner_specified.openstack.object"
711

812
# E2E tests

apps/aurora-portal/src/server/Storage/cephProcedure.ts

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,11 @@ function resolveS3Config(ctx: AuroraPortalContext): { endpoint: string; region:
4545
throw new Error("Region not found in Ceph service endpoints")
4646
}
4747

48-
// Construct Ceph-compatible region identifier using the pattern from Go SDK / Terraform.
49-
// Standard format: ceph-objectstore-st1-{region} (e.g., ceph-objectstore-st1-eu-de-2)
50-
// Exception: qa-de-1 uses "ec" prefix for historical reasons (ceph-objectstore-ec-st1-qa-de-1)
51-
//
52-
// This identifier is used for:
53-
// 1. AWS Signature V4 request signing (region field in Authorization header)
54-
// 2. LocationConstraint in CreateBucket API calls
55-
//
56-
// See: https://documentation.global.cloud.sap/docs/customer/storage/obj-v2-ceph/ceph-storage-options/
57-
const QA_DE_1_REGION = "qa-de-1"
58-
const CEPH_REGION_PREFIX_STANDARD = "ceph-objectstore-st1"
59-
const CEPH_REGION_PREFIX_EC = "ceph-objectstore-ec-st1"
60-
61-
const region =
62-
openstackRegion === QA_DE_1_REGION
63-
? `${CEPH_REGION_PREFIX_EC}-${openstackRegion}`
64-
: `${CEPH_REGION_PREFIX_STANDARD}-${openstackRegion}`
48+
if (!process.env.CEPH_REGION) {
49+
throw new Error("CEPH_REGION environment variable is required. ")
50+
}
51+
52+
const region = process.env.CEPH_REGION
6553

6654
return { endpoint: baseEndpoint, region }
6755
} catch (error) {

0 commit comments

Comments
 (0)