Skip to content

Commit

Permalink
use NormalizeLeaseName to store the key
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Madhu-1 committed Nov 27, 2024
1 parent 0b463a7 commit 35efecb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/controller/csiaddons/csiaddonsnode_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ func (r *CSIAddonsNodeReconciler) Reconcile(ctx context.Context, req ctrl.Reques

// namespace + "/" + leader identity(pod name) is the key for the connection.
// this key is used by GetLeaderByDriver to get the connection
key := csiAddonsNode.Namespace + "/" + podName
// util.NormalizeLeaseName() 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.
key := csiAddonsNode.Namespace + "/" + util.NormalizeLeaseName(podName)

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

Expand Down

0 comments on commit 35efecb

Please sign in to comment.