Skip to content

Commit 6c31248

Browse files
Madhu-1mergify[bot]
authored andcommitted
use NormalizeLeaseName to store the key
namespace + "/" + leader identity(pod name) is the key for the connection. this key is used by GetLeaderByDriver to get the connection. csi-lib-utils/leaderelection:sanitizeName() is used to sanitize the leader identity used for the leases csiaddonsnode need to store the key with same format so that it can be used to get the connection. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
1 parent 0b463a7 commit 6c31248

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/controller/csiaddons/csiaddonsnode_controller.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ func (r *CSIAddonsNodeReconciler) Reconcile(ctx context.Context, req ctrl.Reques
105105

106106
// namespace + "/" + leader identity(pod name) is the key for the connection.
107107
// this key is used by GetLeaderByDriver to get the connection
108-
key := csiAddonsNode.Namespace + "/" + podName
108+
// util.NormalizeLeaseName() is used to sanitize the leader identity used for the leases
109+
// csiaddonsnode need to store the key with same format so that it can be used to get the connection.
110+
key := csiAddonsNode.Namespace + "/" + util.NormalizeLeaseName(podName)
109111

110112
logger = logger.WithValues("EndPoint", endPoint)
111113

0 commit comments

Comments
 (0)