Skip to content

Commit

Permalink
Skip PVCs with key rotation annotation when SC is changed
Browse files Browse the repository at this point in the history
Signed-off-by: Niraj Yadav <[email protected]>
  • Loading branch information
black-dragon74 committed Aug 6, 2024
1 parent 0b1d24a commit ebddffa
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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,
Expand Down

0 comments on commit ebddffa

Please sign in to comment.