From 7420e75a12254717415c9712aaf3c99d53000399 Mon Sep 17 00:00:00 2001 From: Craig Trought Date: Sun, 11 Jun 2023 16:37:20 -0400 Subject: [PATCH] fix: ignore routes owned by ingress Signed-off-by: Craig Trought --- internal/controller/controller.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/controller/controller.go b/internal/controller/controller.go index 66983c7..66b56e6 100644 --- a/internal/controller/controller.go +++ b/internal/controller/controller.go @@ -53,6 +53,14 @@ func (r *Route) Reconcile(ctx context.Context, req reconcile.Request) (reconcile if err != nil { return reconcile.Result{}, err } + if len(route.ObjectMeta.OwnerReferences) > 0 { + for _, o := range route.ObjectMeta.OwnerReferences { + if o.Kind == "Ingress" { + log.V(5).Info("ignoring route owned by ingress", o.Name) + return reconcile.Result{}, nil + } + } + } log.V(5).Info("retrieved route") if metav1.HasAnnotation(route.ObjectMeta, cmapi.IssuerNameAnnotationKey) { log.V(5).Info("route has cert-manager annotation, reconciling", cmapi.IssuerNameAnnotationKey, route.Annotations[cmapi.IssuerNameAnnotationKey])