Skip to content

Commit

Permalink
Merge pull request #3978 from nefelim4ag/master
Browse files Browse the repository at this point in the history
fix(httpProxy): drop status==valid filter
  • Loading branch information
k8s-ci-robot committed Nov 15, 2023
2 parents fb584aa + 42aaa58 commit e1adc90
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
8 changes: 0 additions & 8 deletions source/contour_httpproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
17 changes: 0 additions & 17 deletions source/contour_httpproxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{},
Expand Down Expand Up @@ -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{}
Expand Down Expand Up @@ -1161,7 +1145,6 @@ func (ir fakeHTTPProxy) HTTPProxy() *projectcontour.HTTPProxy {
},
Spec: spec,
Status: projectcontour.HTTPProxyStatus{
CurrentStatus: status,
LoadBalancer: lb,
},
}
Expand Down

0 comments on commit e1adc90

Please sign in to comment.