Skip to content

Commit f33e151

Browse files
Merge pull request #9767 from barbacbd/OCPBUGS-51299
OCPBUGS-51299: Set default project and location for KMS key manifest
2 parents fdc62fc + 298badd commit f33e151

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

pkg/asset/manifests/clustercsidriver.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,22 @@ func (csi *ClusterCSIDriverConfig) Generate(_ context.Context, dependencies asse
9898
return nil
9999
}
100100
kmsKey := platform.OSDisk.EncryptionKey.KMSKey
101+
102+
projectID := kmsKey.ProjectID
103+
if projectID == "" {
104+
projectID = installConfig.Config.GCP.ProjectID
105+
}
106+
107+
location := kmsKey.Location
108+
if location == "" {
109+
location = installConfig.Config.GCP.Region
110+
}
111+
101112
configData, err := gcp.ClusterCSIDriverConfig{
102113
Name: kmsKey.Name,
103114
KeyRing: kmsKey.KeyRing,
104-
ProjectID: kmsKey.ProjectID,
105-
Location: kmsKey.Location,
115+
ProjectID: projectID,
116+
Location: location,
106117
}.YAML()
107118
if err != nil {
108119
return errors.Wrap(err, "could not create CSI cluster driver config")

0 commit comments

Comments
 (0)