Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(httpProxy): drop status==valid filter #3978

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading