linkerd2/controller
Oliver Gould 08f97cc26f
destination: Avoid sending spurious profile updates (#10517)
The GetProfile API endpoint does not behave as expected: when a profile
watch is established, the API server starts two separate profile
watches--a primary watch with the client's namespace and fallback watch
ignoring the client's namespace. These watches race to send data back to
the client. If the backup watch updates first, it may be sent to clients
before being corrected by a subsequent update. If the primary watch
updates with an empty value, the default profile may be served before
being corrected by an update to the backup watch.

From the proxy's perspective, we'd much prefer that the API provide a
single authoritative response when possible. It avoids needless
corrective work from distributing across the system on every watch
initiation.

To fix this, we modify the fallbackProfileListener to behave
predictably: it only emits updates once both its primary and fallback
listeners have been updated. This avoids emitting updates based on a
partial understanding of the cluster state.

Furthermore, the opaquePortsAdaptor is updated to avoid synthesizing a
default serviceprofile (surprising behavior) and, instead, this
defaulting logic is moved into a dedicated defaultProfileListener
helper. A dedupProfileListener is added to squelch obviously redundant
updates.

Finally, this newfound predictability allows us to simplify the API's
tests. Many of the API tests are not clear in what they test and
sometimes make assertions about the "incorrect" profile updates.
2023-03-13 13:36:18 -07:00
..
api destination: Avoid sending spurious profile updates (#10517) 2023-03-13 13:36:18 -07:00
cmd Implement the k8s metadata API in the Destination controller (#10326) 2023-02-13 17:30:07 -05:00
gen Update to dev:v39 with Go 1.19 (#10336) 2023-02-16 08:25:42 -08:00
heartbeat Use go-test/deep for comparisons in tests (#8427) 2022-05-05 09:31:07 -07:00
identity core: use serviceAccountToken volume for pod authentication (#7117) 2021-11-03 02:03:39 +05:30
k8s Implement the k8s metadata API in the Destination controller (#10326) 2023-02-13 17:30:07 -05:00
proxy-injector Upgrading proxy-init from v2.1.0 to v2.2.0 this time without JSON formatting (#10234) 2023-02-01 11:53:02 -08:00
script Enable gocritic linting (#7906) 2022-02-17 22:45:25 +00:00
sp-validator Use metadata API in the proxy and tap injectors (#9650) 2022-11-16 09:21:39 -05:00
webhook Readiness checks fail until caches are synced (#10166) 2023-01-25 11:43:09 -08:00
Dockerfile Update to dev:v39 with Go 1.19 (#10336) 2023-02-16 08:25:42 -08:00