Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update outbound policy watches when routes change parents (#13315)
Fixes #13280 When an xRoute resource is updated to change its parent_refs, the route may attach to new parents or become unattached to parents it was previously attached to. However, in the policy-controller, the xRoute update will only be sent to the parents on the new version of the route resource and any existing watches on parents that the route was unattached from will not be updated. Unfortunately, the kube-rs watch interface only provides the new version of a resource when it is updated, and not the previous state. This means that we cannot know which parents the route might have been unattached to when it was updated. Therefore, we send the route update to all NamespaceIndexes and each one removes that route from each parent if that parent is not currently an accepted parent of the route. We also add integration tests for this behavior. This issue applies to all xRoutes: policy HttpRoute, gateway HttpRoute, GrpcRoute, TlsRoute, and TcpRoute. Signed-off-by: Alex Leong <[email protected]>
- Loading branch information