Skip to content
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

feat(runtime): support for owned shared streams #1483

Merged
merged 3 commits into from May 3, 2024

Conversation

mateiidavid
Copy link
Contributor

We added support for shared streams in the controller via a reflector. There are only two public interfaces available to thread a stream through a controller, for_shared_stream and for_shared_stream_with.

For non-shared streams, the controller can compose with other types of streams that will trigger reconciliation, e.g. streams of owned objects, or custom streams that take mappers out-of-band. For parity, the controller should expose public interfaces to allow the same for shared streams.

This change adds four new interfaces:

  • owns_shared_stream
  • owns_shared_stream_with
  • watches_shared_stream
  • watches_shared_stream_with

The contract is the same as for_shared_stream. Accept a stream of Arc<K> and turn it into a reconciliation trigger.

We added support for shared streams in the controller via a reflector.
There are only two public interfaces available to thread a stream
through a controller, `for_shared_stream` and `for_shared_stream_with`.

For non-shared streams, the controller can compose with other types of
streams that will trigger reconciliation, e.g. streams of owned objects,
or custom streams that take mappers out-of-band. For parity, the
controller should expose public interfaces to allow the same for shared
streams.

This change adds four new interfaces:

* `owns_shared_stream`
* `owns_shared_stream_with`
* `watches_shared_stream`
* `watches_shared_stream_with`

The contract is the same as `for_shared_stream`. Accept a stream of
`Arc<K>` and turn it into a reconciliation trigger.

Signed-off-by: Matei David <matei.david.35@gmail.com>
Copy link

codecov bot commented May 1, 2024

Codecov Report

Attention: Patch coverage is 0% with 23 lines in your changes are missing coverage. Please review.

Project coverage is 74.1%. Comparing base (687506f) to head (52dba2c).

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1483     +/-   ##
=======================================
- Coverage   74.4%   74.1%   -0.2%     
=======================================
  Files         78      78             
  Lines       6778    6801     +23     
=======================================
  Hits        5037    5037             
- Misses      1741    1764     +23     
Files Coverage Δ
kube-runtime/src/controller/mod.rs 29.9% <0.0%> (-2.4%) ⬇️

@clux clux added the unstable feature that unstable feature gating label May 1, 2024
Copy link
Member

@clux clux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very much like what I expected. It's duplication driven atm, and that's fine for now as it's all behind the flag.

kube-runtime/src/controller/mod.rs Show resolved Hide resolved
@clux clux added this to the 0.91.0 milestone May 1, 2024
@clux clux added the changelog-add changelog added category for prs label May 1, 2024
Signed-off-by: Matei David <matei.david.35@gmail.com>
@mateiidavid mateiidavid merged commit 96053fd into kube-rs:main May 3, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-add changelog added category for prs unstable feature that unstable feature gating
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants