-
-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Track store readiness #1243
Track store readiness #1243
Conversation
6752a9b
to
528b7b3
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1243 +/- ##
==========================================
+ Coverage 71.89% 72.60% +0.70%
==========================================
Files 71 72 +1
Lines 5729 5899 +170
==========================================
+ Hits 4119 4283 +164
- Misses 1610 1616 +6
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial comments. Short story is that I really like the approach (even though there's a lot more here than I expected from a one-day nerd snipe). Very good tests.
Some questions mainly around complexity and public interfaces.
Signed-off-by: Natalie Klestrup Röijezon <[email protected]>
Signed-off-by: Natalie Klestrup Röijezon <[email protected]>
Signed-off-by: Natalie Klestrup Röijezon <[email protected]>
Signed-off-by: Natalie Klestrup Röijezon <[email protected]>
Signed-off-by: Natalie Klestrup Röijezon <[email protected]>
Signed-off-by: Natalie Klestrup Röijezon <[email protected]>
Signed-off-by: Natalie Klestrup Röijezon <[email protected]>
Signed-off-by: Natalie Klestrup Röijezon <[email protected]>
a23c80a
to
e50c057
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very transparent from a user POV with debug logs kube=debug
(trimmed timestamps for the 0.1s this took):
INFO kube_runtime::controller: press ctrl+c to shut down gracefully
DEBUG kube_runtime::controller: applier runner held until store is ready
DEBUG HTTP{http.method=GET http.url=https://0.0.0.0:51145/apis/nullable.se/v1/configmapgenerators? otel.name="list" otel.kind="client"}: kube_client::client::builder: requesting
DEBUG HTTP{http.method=GET http.url=https://0.0.0.0:51145/api/v1/configmaps? otel.name="list_metadata" otel.kind="client"}: kube_client::client::builder: requesting
DEBUG kube_runtime::controller: store is ready, starting runner
DEBUG HTTP{http.method=GET http.url=https://0.0.0.0:51145/apis/nullable.se/v1/configmapgenerators?&watch=true&timeoutSeconds=290&allowWatchBookmarks=true&resourceVersion=779 otel.name="watch" otel.kind="client"}: kube_client::client::builder: requesting
DEBUG HTTP{http.method=GET http.url=https://0.0.0.0:51145/api/v1/configmaps?&watch=true&timeoutSeconds=290&allowWatchBookmarks=true&resourceVersion=779 otel.name="watch_metadata" otel.kind="client"}: kube_client::client::builder: requesting
Motivation
Fixes #1226.
Solution
We add a new
wait_until_ready()
method toStore
, which returns aFuture
that completes after any write has been done to the store. If the store has already been changed in the past then it completes immediately.Further,
controller::Runner
is extended with a mechanism that allows us to gate all jobs until a triggerFuture
has completed. This is then used incontroller::applier
to gate reconciliation based on the store readiness introduced earlier.