Skip to content

Commit

Permalink
controllers: set clientProfile name in mapping
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
rewantsoni committed Dec 10, 2024
1 parent 4b75856 commit 80d50e5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/controller/storageclient_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
// TODO: 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)
Expand Down

0 comments on commit 80d50e5

Please sign in to comment.