From f690d35b58a41092b7f785d5c600089d1eef88fb Mon Sep 17 00:00:00 2001 From: Clay Kauzlaric Date: Tue, 23 Apr 2024 12:05:58 -0400 Subject: [PATCH] mark ingress as failed when cant find gateway * marking as not ready was overwriting the failed status --- pkg/reconciler/ingress/ingress.go | 2 +- pkg/reconciler/ingress/ingress_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/reconciler/ingress/ingress.go b/pkg/reconciler/ingress/ingress.go index 87f3b7e8f..35dc8fdd0 100644 --- a/pkg/reconciler/ingress/ingress.go +++ b/pkg/reconciler/ingress/ingress.go @@ -158,12 +158,12 @@ func (c *Reconciler) reconcileIngress(ctx context.Context, ing *v1alpha1.Ingress if routesReady { externalLBs, internalLBs, err := c.lookUpLoadBalancers(ing, pluginConfig) if err != nil { - ing.Status.MarkLoadBalancerNotReady() if _, ok := err.(*GatewayNotFoundError); ok { // if we can't find a Gateway, we mark it as failed, and // return no error, since there is no point in retrying return nil } else { + ing.Status.MarkLoadBalancerNotReady() return err } } diff --git a/pkg/reconciler/ingress/ingress_test.go b/pkg/reconciler/ingress/ingress_test.go index a9a2ec9e1..643257d32 100644 --- a/pkg/reconciler/ingress/ingress_test.go +++ b/pkg/reconciler/ingress/ingress_test.go @@ -2315,7 +2315,7 @@ func TestReconcileProbingOffClusterGateway(t *testing.T) { withFinalizer, func(i *v1alpha1.Ingress) { i.Status.InitializeConditions() - i.Status.MarkLoadBalancerNotReady() + i.Status.MarkLoadBalancerFailed("GatewayDoesNotExist", "could not find Gateway istio-system/istio-gateway") i.Status.MarkNetworkConfigured() })}}, }}