From 500f00c009eebaa89c1f6eb7cfe81ac186218c3c Mon Sep 17 00:00:00 2001 From: Rewant Soni Date: Mon, 9 Dec 2024 20:01:44 +0530 Subject: [PATCH] controllers: set clientProfile name in mapping set the client profile name in the mapping cr to be a hash of storageclaim name till we move to a single clientProfile for the entire client Signed-off-by: Rewant Soni --- internal/controller/storageclient_controller.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/controller/storageclient_controller.go b/internal/controller/storageclient_controller.go index c1585c13..8e855d66 100644 --- a/internal/controller/storageclient_controller.go +++ b/internal/controller/storageclient_controller.go @@ -250,6 +250,13 @@ func (r *StorageClientReconciler) reconcilePhases() (ctrl.Result, error) { if err := json.Unmarshal(eResource.Data, &clientProfileMapping.Spec); err != nil { return fmt.Errorf("failed to unmarshall clientProfileMapping spec: %v", err) } + // This is a temporary solution till we have a single clientProfile for all storageClass + // sent from Provider + clientProfileHash := utils.GetMD5Hash(fmt.Sprintf("%s-ceph-rbd", r.storageClient.Name)) + for i := range clientProfileMapping.Spec.Mappings { + clientProfileMapping.Spec.Mappings[i].LocalClientProfile = clientProfileHash + clientProfileMapping.Spec.Mappings[i].RemoteClientProfile = clientProfileHash + } return nil }); err != nil { return reconcile.Result{}, fmt.Errorf("failed to reconcile clientProfileMapping: %v", err)