Skip to content

Commit

Permalink
provider: fix clientProfileName calculation
Browse files Browse the repository at this point in the history
Signed-off-by: Rewant Soni <resoni@redhat.com>
  • Loading branch information
rewantsoni committed Dec 9, 2024
1 parent 1d6235c commit 8defa00
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion services/provider/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package server
import (
"context"
"crypto"
"crypto/md5"
"crypto/rsa"
"crypto/sha256"
"crypto/x509"
Expand Down Expand Up @@ -465,7 +466,9 @@ func (s *OCSProviderServer) getExternalResources(ctx context.Context, consumerRe
// The current proposal is to read the clientProfile name from the storageConsumer status and
// the remote ClientProfile name should be fetched from the GetClientsInfo rpc
clientName := consumerResource.Status.Client.Name
clientProfileName := util.CalculateMD5Hash(fmt.Sprintf("%s-ceph-rbd", clientName))
// Using the same hash function we have in client op to calculate the clientProfile Name
clientProfileHash := md5.Sum([]byte(fmt.Sprintf("%s-ceph-rbd", clientName)))
clientProfileName := hex.EncodeToString(clientProfileHash[:])
extR = append(extR, &pb.ExternalResource{
Name: consumerResource.Status.Client.Name,
Kind: "ClientProfileMapping",
Expand Down

0 comments on commit 8defa00

Please sign in to comment.