From ebddffaa7b3dac38d534b1f76026bfd575f67f18 Mon Sep 17 00:00:00 2001 From: Niraj Yadav Date: Tue, 6 Aug 2024 17:21:26 +0530 Subject: [PATCH] Skip PVCs with key rotation annotation when SC is changed Signed-off-by: Niraj Yadav --- .../csiaddons/persistentvolumeclaim_controller.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/controller/csiaddons/persistentvolumeclaim_controller.go b/internal/controller/csiaddons/persistentvolumeclaim_controller.go index 8555e65ee..71701ef20 100644 --- a/internal/controller/csiaddons/persistentvolumeclaim_controller.go +++ b/internal/controller/csiaddons/persistentvolumeclaim_controller.go @@ -293,7 +293,8 @@ func (r *PersistentVolumeClaimReconciler) determineScheduleAndRequeue( // storageClassEventHandler returns an EventHandler that responds to changes // in StorageClass objects and generates reconciliation requests for all // PVCs associated with the changed StorageClass. -// PVCs with rsCronJobScheduleTimeAnnotation are not enqueued. +// PVCs with either rsCronJobScheduleTimeAnnotation or +// krcJobScheduleTimeAnnotation are not enqueued. func (r *PersistentVolumeClaimReconciler) storageClassEventHandler() handler.EventHandler { return handler.EnqueueRequestsFromMapFunc( func(ctx context.Context, obj client.Object) []reconcile.Request { @@ -317,6 +318,9 @@ func (r *PersistentVolumeClaimReconciler) storageClassEventHandler() handler.Eve if _, ok := pvc.GetAnnotations()[rsCronJobScheduleTimeAnnotation]; ok { continue } + if _, ok := pvc.GetAnnotations()[krcJobScheduleTimeAnnotation]; ok { + continue + } requests = append(requests, reconcile.Request{ NamespacedName: types.NamespacedName{ Name: pvc.Name,