File tree Expand file tree Collapse file tree 3 files changed +28
-2
lines changed
Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change 4848 #
4949 # Optional.
5050 storeEndpoint : storage-example.p.googleapis.com
51+
52+ # Configuration of the universe domain
53+ #
54+ # Optional.
55+ universeDomain : googleapis.com
5156` ` `
Original file line number Diff line number Diff line change 1+ # Add universeDomain parameter for GCS client
2+
3+ ** Type:** Feature
4+
5+ ** Description:**
6+ Introduce a new ` universeDomain ` key in the BackupStorageLocation ` spec.config ` map,
7+ allowing users to override the default Google Storage domain (defaults to ` "googleapis.com" ` ).
8+
9+ ** Motivation:**
10+ - Support custom or private GCS-compatible endpoints (e.g. testing, on‑prem).
11+ - Align with Helm chart support for ` universeDomain ` .
12+
13+ ** Changes:**
14+ - Updated ` object_storage.go ` to inject ` option.WithUniverseDomain(...) ` .
Original file line number Diff line number Diff line change @@ -37,9 +37,10 @@ import (
3737
3838const (
3939 kmsKeyNameConfigKey = "kmsKeyName"
40- serviceAccountConfig = "serviceAccount"
40+ serviceAccountConfigKey = "serviceAccount"
4141 credentialsFileConfigKey = "credentialsFile"
4242 storeEndpointConfigKey = "storeEndpoint"
43+ universeDomainKey = "universeDomain"
4344)
4445
4546// bucketWriter wraps the GCP SDK functions for accessing object store so they can be faked for testing.
@@ -100,9 +101,10 @@ func (o *ObjectStore) Init(config map[string]string) error {
100101 if err := veleroplugin .ValidateObjectStoreConfigKeys (
101102 config ,
102103 kmsKeyNameConfigKey ,
103- serviceAccountConfig ,
104+ serviceAccountConfigKey ,
104105 credentialsFileConfigKey ,
105106 storeEndpointConfigKey ,
107+ universeDomainKey ,
106108 ); err != nil {
107109 return err
108110 }
@@ -146,6 +148,11 @@ func (o *ObjectStore) Init(config map[string]string) error {
146148 clientOptions = append (clientOptions , option .WithEndpoint (endpoint ))
147149 }
148150
151+ // if using a universeDomain, we need to pass it when creating the object store client
152+ if universeDomain , ok := config [universeDomainKey ]; ok {
153+ clientOptions = append (clientOptions , option .WithUniverseDomain (universeDomain ))
154+ }
155+
149156 if creds .JSON != nil {
150157 o .fileCredType , err = getSecretAccountTypeKey (creds .JSON )
151158 if err != nil {
You can’t perform that action at this time.
0 commit comments