Conversation
|
I did some test runs with extra logging in dev-blue while I was figuring out how all this should work. #74 (comment) |
| return false | ||
| } | ||
|
|
||
| if r.validateServiceOwnedByGateway(newSvc) { |
There was a problem hiding this comment.
is this redundant since the other service predicate already check this? If so then there is no need to make any changes to validateServiceForReconcile.
There was a problem hiding this comment.
This is a bit unclear to me.
Doespredicate.And always run both validateServiceForReconcile and validateServiceUpdateForReconcile? If not, we'd need to make sure this function returns true when the service is owned by gateway controller so the other predicate has to run.
I made a minor effort to distinguish the behaviour with my debug builds, but I didn't make a clear determination.
There was a problem hiding this comment.
I've reverted all changes to validateServiceForReconcile and modified validateServiceUpdateForReconcile to check if the service is owned by a gateway and return true in that case. 8774127
From what I see, predicate.And will only iterate predicate functions until one is false: https://github.com/kubernetes-sigs/controller-runtime/blob/5dfe3216fb7fd7f5afb61d6d0f8956c7bec8df62/pkg/predicate/predicate.go#L309-L316
Iteration of a predicate slice is indeterminate. This means we can only return false in the specific scenario we want to exclude from reconciliation when we're modifying the existing behaviour using predicate.And.
d0e0fbc to
e580781
Compare
add tests invert service conditions in validateServiceUpdateForReconcile
e580781 to
8774127
Compare
|
Ran a debug build ( When I edit the service to change the pod selector we see the new predicate blocking reconciliation of the service update event: |
This PR adds on to the behaviour change in #72.
Modifies the predicate filters on the the
servicewatch so update events for services without endpoint routing will only trigger a reconcile if the cluster IP changes.Adjusts the resource tree builder so endpoints are not collected when a service does not use endpoint routing.