Skip to content

Commit c94f29c

Browse files
rewantsoniopenshift-cherrypick-robot
authored and
openshift-cherrypick-robot
committed
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 <[email protected]>
1 parent 8b37047 commit c94f29c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

internal/controller/storageclient_controller.go

+7
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,13 @@ func (r *StorageClientReconciler) reconcilePhases() (ctrl.Result, error) {
250250
if err := json.Unmarshal(eResource.Data, &clientProfileMapping.Spec); err != nil {
251251
return fmt.Errorf("failed to unmarshall clientProfileMapping spec: %v", err)
252252
}
253+
// TODO: This is a temporary solution till we have a single clientProfile for all storageClass
254+
// sent from Provider
255+
clientProfileHash := utils.GetMD5Hash(fmt.Sprintf("%s-ceph-rbd", r.storageClient.Name))
256+
for i := range clientProfileMapping.Spec.Mappings {
257+
clientProfileMapping.Spec.Mappings[i].LocalClientProfile = clientProfileHash
258+
clientProfileMapping.Spec.Mappings[i].RemoteClientProfile = clientProfileHash
259+
}
253260
return nil
254261
}); err != nil {
255262
return reconcile.Result{}, fmt.Errorf("failed to reconcile clientProfileMapping: %v", err)

0 commit comments

Comments
 (0)