Skip to content

Commit

Permalink
mark ingress as failed when cant find gateway
Browse files Browse the repository at this point in the history
* marking as not ready was overwriting the failed status
  • Loading branch information
KauzClay committed Apr 23, 2024
1 parent b522864 commit f690d35
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/reconciler/ingress/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Check failure on line 161 in pkg/reconciler/ingress/ingress.go

View workflow job for this annotation

GitHub Actions / style / Golang / Lint

type assertion on error will fail on wrapped errors. Use errors.As to check for specific errors (errorlint)
// 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 {

Check warning on line 165 in pkg/reconciler/ingress/ingress.go

View workflow job for this annotation

GitHub Actions / style / Golang / Lint

indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive)
ing.Status.MarkLoadBalancerNotReady()
return err
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/ingress/ingress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})}},
}}
Expand Down

0 comments on commit f690d35

Please sign in to comment.