From 8a8df8a3c70687d17b6dfa358388a09bb970af91 Mon Sep 17 00:00:00 2001 From: Miguel Varela Ramos Date: Thu, 18 Jul 2024 11:49:27 +0100 Subject: [PATCH] fix: do not present challenge for Gateway API if feature not enabled Signed-off-by: Miguel Varela Ramos --- pkg/issuer/acme/http/http.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/issuer/acme/http/http.go b/pkg/issuer/acme/http/http.go index 8858f1665..f1b71f799 100644 --- a/pkg/issuer/acme/http/http.go +++ b/pkg/issuer/acme/http/http.go @@ -125,6 +125,9 @@ func (s *Solver) Present(ctx context.Context, issuer v1.GenericIssuer, ch *cmacm return utilerrors.NewAggregate([]error{podErr, svcErr, ingressErr}) } if ch.Spec.Solver.HTTP01.GatewayHTTPRoute != nil { + if !s.GatewaySolverEnabled { + return fmt.Errorf("couldn't Present challenge %s/%s: gateway api is not enabled", ch.Namespace, ch.Name) + } _, gatewayErr = s.ensureGatewayHTTPRoute(ctx, ch, svcName) return utilerrors.NewAggregate([]error{podErr, svcErr, gatewayErr}) }