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 48
48
#
49
49
# Optional.
50
50
storeEndpoint : storage-example.p.googleapis.com
51
+
52
+ # Configuration of the universe domain
53
+ #
54
+ # Optional.
55
+ universeDomain : googleapis.com
51
56
` ` `
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 (
37
37
38
38
const (
39
39
kmsKeyNameConfigKey = "kmsKeyName"
40
- serviceAccountConfig = "serviceAccount"
40
+ serviceAccountConfigKey = "serviceAccount"
41
41
credentialsFileConfigKey = "credentialsFile"
42
42
storeEndpointConfigKey = "storeEndpoint"
43
+ universeDomainKey = "universeDomain"
43
44
)
44
45
45
46
// 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 {
100
101
if err := veleroplugin .ValidateObjectStoreConfigKeys (
101
102
config ,
102
103
kmsKeyNameConfigKey ,
103
- serviceAccountConfig ,
104
+ serviceAccountConfigKey ,
104
105
credentialsFileConfigKey ,
105
106
storeEndpointConfigKey ,
107
+ universeDomainKey ,
106
108
); err != nil {
107
109
return err
108
110
}
@@ -146,6 +148,11 @@ func (o *ObjectStore) Init(config map[string]string) error {
146
148
clientOptions = append (clientOptions , option .WithEndpoint (endpoint ))
147
149
}
148
150
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
+
149
156
if creds .JSON != nil {
150
157
o .fileCredType , err = getSecretAccountTypeKey (creds .JSON )
151
158
if err != nil {
You can’t perform that action at this time.
0 commit comments