From 42aaa58232d898db56527cbd91492c136668a379 Mon Sep 17 00:00:00 2001 From: Timofey Titovets Date: Tue, 10 Oct 2023 14:02:55 +0200 Subject: [PATCH] fix(httpProxy): drop status==valid filter --- source/contour_httpproxy.go | 8 -------- source/contour_httpproxy_test.go | 17 ----------------- 2 files changed, 25 deletions(-) diff --git a/source/contour_httpproxy.go b/source/contour_httpproxy.go index 818646e42..fb028dc64 100644 --- a/source/contour_httpproxy.go +++ b/source/contour_httpproxy.go @@ -140,9 +140,6 @@ func (sc *httpProxySource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, log.Debugf("Skipping HTTPProxy %s/%s because controller value does not match, found: %s, required: %s", hp.Namespace, hp.Name, controller, controllerAnnotationValue) continue - } else if hp.Status.CurrentStatus != "valid" { - log.Debugf("Skipping HTTPProxy %s/%s because it is not valid", hp.Namespace, hp.Name) - continue } hpEndpoints, err := sc.endpointsFromHTTPProxy(hp) @@ -244,11 +241,6 @@ func (sc *httpProxySource) filterByAnnotations(httpProxies []*projectcontour.HTT // endpointsFromHTTPProxyConfig extracts the endpoints from a Contour HTTPProxy object func (sc *httpProxySource) endpointsFromHTTPProxy(httpProxy *projectcontour.HTTPProxy) ([]*endpoint.Endpoint, error) { - if httpProxy.Status.CurrentStatus != "valid" { - log.Warn(errors.Errorf("cannot generate endpoints for HTTPProxy with status %s", httpProxy.Status.CurrentStatus)) - return nil, nil - } - resource := fmt.Sprintf("HTTPProxy/%s/%s", httpProxy.Namespace, httpProxy.Name) ttl := getTTLFromAnnotations(httpProxy.Annotations, resource) diff --git a/source/contour_httpproxy_test.go b/source/contour_httpproxy_test.go index e90bd059a..f26d2b029 100644 --- a/source/contour_httpproxy_test.go +++ b/source/contour_httpproxy_test.go @@ -269,14 +269,6 @@ func testEndpointsFromHTTPProxy(t *testing.T) { httpProxy: fakeHTTPProxy{}, expected: []*endpoint.Endpoint{}, }, - { - title: "one rule.host invalid httpproxy", - httpProxy: fakeHTTPProxy{ - host: "foo.bar", - invalid: true, - }, - expected: []*endpoint.Endpoint{}, - }, { title: "no targets", httpProxy: fakeHTTPProxy{}, @@ -1114,19 +1106,11 @@ type fakeHTTPProxy struct { annotations map[string]string host string - invalid bool delegate bool loadBalancer fakeLoadBalancerService } func (ir fakeHTTPProxy) HTTPProxy() *projectcontour.HTTPProxy { - var status string - if ir.invalid { - status = "invalid" - } else { - status = "valid" - } - var spec projectcontour.HTTPProxySpec if ir.delegate { spec = projectcontour.HTTPProxySpec{} @@ -1161,7 +1145,6 @@ func (ir fakeHTTPProxy) HTTPProxy() *projectcontour.HTTPProxy { }, Spec: spec, Status: projectcontour.HTTPProxyStatus{ - CurrentStatus: status, LoadBalancer: lb, }, }