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

runtime: rename references from Flatten to Filter where necessary #1520

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

clux
Copy link
Member

@clux clux commented Jun 13, 2024

closes #1517 - we no longer flatten anything.

creates a deprecated type alias for EventFlatten in its place because is actually exposed. Users of WatchStreamExt direct will not notice / care for this, but would be nice if direct users - if they exist - get a warning.

docs updated in kube-rs/website#66

@clux clux added the changelog-change changelog change category for prs label Jun 13, 2024
@clux clux added this to the 0.93.0 milestone Jun 13, 2024
Copy link

codecov bot commented Jun 13, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 75.7%. Comparing base (f74576f) to head (dd70467).

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1520   +/-   ##
=====================================
  Coverage   75.7%   75.7%           
=====================================
  Files         79      79           
  Lines       7252    7252           
=====================================
  Hits        5487    5487           
  Misses      1765    1765           
Files Coverage Δ
kube-runtime/src/utils/event_filter.rs 91.2% <100.0%> (ø)
kube-runtime/src/utils/mod.rs 62.3% <ø> (ø)
kube-runtime/src/watcher.rs 42.1% <ø> (ø)
kube-runtime/src/utils/watch_ext.rs 22.3% <50.0%> (ø)

@clux clux marked this pull request as ready for review June 13, 2024 21:42
@clux clux requested a review from mateiidavid June 18, 2024 16:02
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.

No blockers from my side, although I did have some thoughts. Looks good and it's nice we managed to simplify the whole machinery!

kube-runtime/src/utils/mod.rs Show resolved Hide resolved
@@ -9,17 +9,17 @@ use pin_project::pin_project;
#[pin_project]
/// Stream returned by the [`applied_objects`](super::WatchStreamExt::applied_objects) and [`touched_objects`](super::WatchStreamExt::touched_objects) method.
#[must_use = "streams do nothing unless polled"]
pub struct EventFlatten<St> {
pub struct EventFilter<St> {
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpicky thought: EventFilter sounds like a good name imo, especially given its use now. I wonder thought if it makes sense to me because I've seen it before. Would users conflate it with PredicateFilter (although, being my own's devil advocate, that's what docs are for).

Would a name like EventDecode work better to convey that what we are actually doing is just taking the inner value?

Copy link
Member Author

Choose a reason for hiding this comment

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

hm, yeah... possibly. maybe i'll hang on to this PR for a little bit first to see if it clashes with use cases for stream forwarding (since it was also running into the same issues.

kube-runtime/src/utils/mod.rs Outdated Show resolved Hide resolved
@clux clux removed this from the 0.93.0 milestone Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-change changelog change category for prs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove relics of unflattened / flattened stream
2 participants