-
Notifications
You must be signed in to change notification settings - Fork 16
Reconcile xRoutes when the Services they reference are modified #247
Conversation
When Services are modified, we need to re-reconcile any HTTPRoute that references them
Planning to add more test coverage next week |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM assuming currently-skipped test passes and adding the additional routes to the HTTP route controller tests still passes as expected.
Suggested changes for HTTP route controller apply to TCP route controller too.
// is affected. No need to check other refs, skip ahead to next HTTPRoute. | ||
if refNamespace == service.Namespace && ref.Name == gateway.ObjectName(service.Name) { | ||
matches = append(matches, route) | ||
break nextRoute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL a use case for goto syntax that doesn't feel too gross.
Co-authored-by: Mike Morris <mikemorris@users.noreply.github.com>
Co-authored-by: Mike Morris <mikemorris@users.noreply.github.com>
@@ -1,5 +1,4 @@ | |||
//go:build e2e | |||
// +build e2e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the old format which was replaced by the go:build
format in go 1.17 (docs)
a36578f
to
34bf843
Compare
Fixes #230
Changes proposed in this PR:
Re-reconcile
HTTPRoutes
andTCPRoutes
when KubernetesService
objects that the route(s) reference as backends are created, modified, or deleted.How I've tested this PR:
Set up service(s) w/ backends using the Learn guide setup on Kind
Verify everything is working
:8443
listenerDelete all services referenced by HTTPRoutes
Verify that listener is removed from gateway
:8443
listenerRestore services
Verify everything is working again after a few seconds for syncing
:8443
listenerHow I expect reviewers to test this PR:
See above
Checklist: