From 94bb3f3a4cf6be1e309bbc4592077ebe66c6a6c1 Mon Sep 17 00:00:00 2001 From: Jim Fitzpatrick Date: Wed, 6 Dec 2023 09:40:04 +0000 Subject: [PATCH] Fixing reconcile due to failing integration test --- controllers/kuadrant_controller.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/controllers/kuadrant_controller.go b/controllers/kuadrant_controller.go index fd24c14c0..34d87c865 100644 --- a/controllers/kuadrant_controller.go +++ b/controllers/kuadrant_controller.go @@ -19,6 +19,7 @@ package controllers import ( "context" "encoding/json" + "reflect" "github.com/kuadrant/kuadrant-operator/pkg/kuadranttools" corev1 "k8s.io/api/core/v1" @@ -508,6 +509,22 @@ func (r *KuadrantReconciler) reconcileLimitador(ctx context.Context, kObj *kuadr limitador.Spec.Storage = kObj.Spec.Limitador.Storage } } + + tmp := &limitadorv1alpha1.Limitador{ + ObjectMeta: metav1.ObjectMeta{ + Name: "temp", + Namespace: kObj.Namespace, + }, + } + err = r.SetOwnerReference(kObj, tmp) + if err != nil { + return err + } + + if limitador.OwnerReferences != nil && !reflect.DeepEqual(tmp.OwnerReferences, limitador.OwnerReferences) { + return nil + } + err = r.SetOwnerReference(kObj, limitador) if err != nil { return err