linkerd2/policy-test
Alex Leong 97f161c262
Use namespace field of backend ref when it is set (#10909)
When the `namespace` field of a `backend_ref` of an `HttpRoute` is set, Linkerd ignores this field and instead assumes that the backend is in the same namespace as the parent `Service`.  

To properly handle the case where the backend is in a different namespace from the parent `Service`, we change the way that service metadata is stored in the policy controller outbound index.  Instead of keeping a separate service metadata map per namespace, we maintain one global service metadata map which is shared between all namespaces using an RwLock.  This allows us to make the two necessary changes:

1. When validating the existence of a backend service, we now look for it in the appropriate namespace instead of the Service's namespace
2. When constructing the backend authority, we use the appropriate namespace instead of the Service's namespace

We also add an API test for this situation.

Signed-off-by: Alex Leong <alex@buoyant.io>
2023-05-19 09:32:01 -07:00
..
src Use namespace field of backend ref when it is set (#10909) 2023-05-19 09:32:01 -07:00
tests Use namespace field of backend ref when it is set (#10909) 2023-05-19 09:32:01 -07:00
Cargo.toml update `linkerd2-proxy-api` to v0.9.0 (#10724) 2023-04-10 13:27:36 -07:00
README.md dev: Run policy tests via `just` (#8919) 2022-07-19 14:01:26 -07:00

README.md

Policy controller tests

The policy-test crate includes integration tests for the policy controller.

Running locally

:; just policy-test

Running in CI

See the workflow.