fix(httpProxy): drop status==valid filter

This commit is contained in:
Timofey Titovets 2023-10-10 14:02:55 +02:00
parent 0725104c9e
commit 42aaa58232
2 changed files with 0 additions and 25 deletions

View File

@ -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)

View File

@ -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,
},
}