Skip to content

Commit e1adc90

Browse files
authored
Merge pull request #3978 from nefelim4ag/master
fix(httpProxy): drop status==valid filter
2 parents fb584aa + 42aaa58 commit e1adc90

File tree

2 files changed

+0
-25
lines changed

2 files changed

+0
-25
lines changed

source/contour_httpproxy.go

-8
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,6 @@ func (sc *httpProxySource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint,
140140
log.Debugf("Skipping HTTPProxy %s/%s because controller value does not match, found: %s, required: %s",
141141
hp.Namespace, hp.Name, controller, controllerAnnotationValue)
142142
continue
143-
} else if hp.Status.CurrentStatus != "valid" {
144-
log.Debugf("Skipping HTTPProxy %s/%s because it is not valid", hp.Namespace, hp.Name)
145-
continue
146143
}
147144

148145
hpEndpoints, err := sc.endpointsFromHTTPProxy(hp)
@@ -244,11 +241,6 @@ func (sc *httpProxySource) filterByAnnotations(httpProxies []*projectcontour.HTT
244241

245242
// endpointsFromHTTPProxyConfig extracts the endpoints from a Contour HTTPProxy object
246243
func (sc *httpProxySource) endpointsFromHTTPProxy(httpProxy *projectcontour.HTTPProxy) ([]*endpoint.Endpoint, error) {
247-
if httpProxy.Status.CurrentStatus != "valid" {
248-
log.Warn(errors.Errorf("cannot generate endpoints for HTTPProxy with status %s", httpProxy.Status.CurrentStatus))
249-
return nil, nil
250-
}
251-
252244
resource := fmt.Sprintf("HTTPProxy/%s/%s", httpProxy.Namespace, httpProxy.Name)
253245

254246
ttl := getTTLFromAnnotations(httpProxy.Annotations, resource)

source/contour_httpproxy_test.go

-17
Original file line numberDiff line numberDiff line change
@@ -269,14 +269,6 @@ func testEndpointsFromHTTPProxy(t *testing.T) {
269269
httpProxy: fakeHTTPProxy{},
270270
expected: []*endpoint.Endpoint{},
271271
},
272-
{
273-
title: "one rule.host invalid httpproxy",
274-
httpProxy: fakeHTTPProxy{
275-
host: "foo.bar",
276-
invalid: true,
277-
},
278-
expected: []*endpoint.Endpoint{},
279-
},
280272
{
281273
title: "no targets",
282274
httpProxy: fakeHTTPProxy{},
@@ -1114,19 +1106,11 @@ type fakeHTTPProxy struct {
11141106
annotations map[string]string
11151107

11161108
host string
1117-
invalid bool
11181109
delegate bool
11191110
loadBalancer fakeLoadBalancerService
11201111
}
11211112

11221113
func (ir fakeHTTPProxy) HTTPProxy() *projectcontour.HTTPProxy {
1123-
var status string
1124-
if ir.invalid {
1125-
status = "invalid"
1126-
} else {
1127-
status = "valid"
1128-
}
1129-
11301114
var spec projectcontour.HTTPProxySpec
11311115
if ir.delegate {
11321116
spec = projectcontour.HTTPProxySpec{}
@@ -1161,7 +1145,6 @@ func (ir fakeHTTPProxy) HTTPProxy() *projectcontour.HTTPProxy {
11611145
},
11621146
Spec: spec,
11631147
Status: projectcontour.HTTPProxyStatus{
1164-
CurrentStatus: status,
11651148
LoadBalancer: lb,
11661149
},
11671150
}

0 commit comments

Comments
 (0)