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

Fix minor broken doc links and add missing feature flag #1471

Merged
merged 2 commits into from Apr 19, 2024
Merged

Conversation

clux
Copy link
Member

@clux clux commented Apr 18, 2024

minor things when browsing runtime with just doc. fairly insignificant.

Signed-off-by: clux <sszynrae@gmail.com>
@clux clux added the changelog-exclude changelog excluded prs label Apr 18, 2024
@clux clux added this to the 0.91.0 milestone Apr 18, 2024
@clux clux marked this pull request as ready for review April 18, 2024 22:24
Copy link

codecov bot commented Apr 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.7%. Comparing base (c89a419) to head (1c66d64).

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1471   +/-   ##
=====================================
  Coverage   74.7%   74.7%           
=====================================
  Files         79      79           
  Lines       6868    6868           
=====================================
  Hits        5125    5125           
  Misses      1743    1743           
Files Coverage Δ
kube-runtime/src/reflector/mod.rs 100.0% <ø> (ø)
kube-runtime/src/reflector/store.rs 99.2% <ø> (ø)
kube-runtime/src/scheduler.rs 97.1% <ø> (ø)
kube-runtime/src/utils/watch_ext.rs 21.1% <ø> (ø)

@mateiidavid
Copy link
Contributor

Nice!

A quick TIOLI:

noticed we don't say anything about sharing events in the reflector() docs. I added a small paragraph towards the end. Posting the patch in case it's helpful.

diff --git a/kube-runtime/src/reflector/mod.rs b/kube-runtime/src/reflector/mod.rs
index 2c6048ba..da7da986 100644
--- a/kube-runtime/src/reflector/mod.rs
+++ b/kube-runtime/src/reflector/mod.rs
@@ -98,6 +98,21 @@ pub use store::{store, Store};
 /// Additionally, only `labels`, `annotations` and `managed_fields` are safe to drop from `ObjectMeta`.
 ///
 /// For more information check out: <https://kube.rs/controllers/optimization/> for graphs and techniques.
+///
+/// ## Stream sharing
+///
+/// `reflector()` as an interface may optionally create a stream that can be
+/// shared with other components to help with resource usage.
+///
+/// To share a stream, the `Writer<K>` consumed by `reflector()` must be
+/// created through an interface that allows a store to be subscribed on, such
+/// as [`store_shared()`]. When the store supports being subscribed on, it will
+/// broadcast an event to all active listeners after caching any object
+/// contained in the event.
+/// 
+/// Creating subscribers requires an
+/// [`unstable`](https://github.com/kube-rs/kube/blob/main/kube-runtime/Cargo.toml#L17-L21)
+/// feature
 pub fn reflector<K, W>(mut writer: store::Writer<K>, stream: W) -> impl Stream<Item = W::Item>
 where
     K: Lookup + Clone,

Copy link
Contributor

@mateiidavid mateiidavid left a comment

Choose a reason for hiding this comment

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

LGTM! Left a small tioli note on adding docs about sharing streams for reflector().

kube-runtime/src/reflector/store.rs Show resolved Hide resolved
Signed-off-by: clux <sszynrae@gmail.com>
@clux clux merged commit 79d23a0 into main Apr 19, 2024
18 checks passed
@clux clux deleted the docs-shared-stream branch April 19, 2024 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-exclude changelog excluded prs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants