Skip to content

Commit

Permalink
Update outbound policy watches when routes change parents (#13315)
Browse files Browse the repository at this point in the history
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 <alex@buoyant.io>
  • Loading branch information
adleong authored Nov 14, 2024
1 parent d469dad commit 59be08e
Show file tree
Hide file tree
Showing 6 changed files with 707 additions and 223 deletions.
Loading

0 comments on commit 59be08e

Please sign in to comment.