@@ -58,21 +58,17 @@ func (r *RulerActionReconciler) Reconcile(ctx context.Context, req ctrl.Request)
58
58
59
59
// 1. Get the content of the Patch
60
60
61
- // 1.1 Try with RulerAction resource first. If it is not a RulerAction , then it will return an error
62
- // but reconcile will try if it is an Event resource relationated with a RulerAction
61
+ // 1.1 Try with Event resource first. If it is not an Event , then it will return an error
62
+ // but reconcile will try if it is a RulerAction resource relationated with an Event
63
63
RulerActionResource := & searchrulerv1alpha1.RulerAction {}
64
- err = r .Get (ctx , req .NamespacedName , RulerActionResource )
65
- if err != nil {
66
- // 1.2 Try with Event resource, if the event is not relationated with a RulerAction, then it will return an error
67
- // but if true, the program goes to processEvent label, so events do not need to execute the rest of the code
68
- * RulerActionResource , err = r .GetEventRuleAction (ctx , req .Namespace , req .Name )
69
- if err != nil {
70
- return result , fmt .Errorf (GetRulerActionErrorMessage , err .Error ())
71
- }
72
- // Go to processEvent Label in step 7 (Sync function)
64
+ * RulerActionResource , err = r .GetEventRuleAction (ctx , req .Namespace , req .Name )
65
+ if err == nil {
73
66
goto processEvent
74
67
}
75
68
69
+ // 1.2 Try with RulerAction resource
70
+ err = r .Get (ctx , req .NamespacedName , RulerActionResource )
71
+
76
72
// 2. Check existence on the cluster
77
73
if err != nil {
78
74
0 commit comments