From 8065526d5c649e820c9ecf5aae4fd6017c3a7dcc Mon Sep 17 00:00:00 2001 From: Kaushik Vijayakumar Date: Tue, 26 Nov 2024 23:53:08 +0530 Subject: [PATCH] Add skip-reconcile annotation support for controlled operator pause --- operator/redisfailover/handler.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/operator/redisfailover/handler.go b/operator/redisfailover/handler.go index 915cb5272..71cd3ecab 100644 --- a/operator/redisfailover/handler.go +++ b/operator/redisfailover/handler.go @@ -58,7 +58,15 @@ func (r *RedisFailoverHandler) Handle(_ context.Context, obj runtime.Object) err if !ok { return fmt.Errorf("can't handle the received object: not a redisfailover") } - + + if rf.Annotations != nil { + skipReconcile, ok := rf.Annotations["skip-reconcile"] + if ok && skipReconcile == "true" { + r.logger.Infoln("skip-reconcile set to true. Skipping reconcile for", rf.Name) + return nil + } + } + if err := rf.Validate(); err != nil { r.mClient.SetClusterError(rf.Namespace, rf.Name) return err