From 3842558396b2b04fcdbd40ba1075eb9344f765ec Mon Sep 17 00:00:00 2001 From: vbadrina Date: Thu, 5 Dec 2024 16:01:44 +0530 Subject: [PATCH] Adds StorageClusterPeer annotation to client pair mapping Signed-off-by: vbadrina --- controllers/mirrorpeer_controller.go | 3 +++ controllers/utils/configmap.go | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/controllers/mirrorpeer_controller.go b/controllers/mirrorpeer_controller.go index 9981ef1c..ab19248f 100644 --- a/controllers/mirrorpeer_controller.go +++ b/controllers/mirrorpeer_controller.go @@ -348,6 +348,9 @@ func updateProviderConfigMap(logger *slog.Logger, ctx context.Context, client cl ObjectMeta: metav1.ObjectMeta{ Name: "storage-client-mapping", Namespace: providerClientInfo.ProviderInfo.NamespacedName.Namespace, + Annotations: map[string]string{ + utils.StorageClusterPeerNameAnnotationKey: getStorageClusterPeerName(pairedClientInfo.ProviderInfo.ProviderManagedClusterName), + }, }, Data: make(map[string]string), } diff --git a/controllers/utils/configmap.go b/controllers/utils/configmap.go index b03b5c5a..0c18a076 100644 --- a/controllers/utils/configmap.go +++ b/controllers/utils/configmap.go @@ -14,9 +14,10 @@ import ( ) const ( - ODFInfoConfigMapName = "odf-info" - ConfigMapResourceType = "ConfigMap" - ClientInfoConfigMapName = "odf-client-info" + ODFInfoConfigMapName = "odf-info" + ConfigMapResourceType = "ConfigMap" + ClientInfoConfigMapName = "odf-client-info" + StorageClusterPeerNameAnnotationKey = "ocs.openshift.io/storage-cluster-peer" ) // FetchConfigMap fetches a ConfigMap with a given name from a given namespace