kube-rs / kube

Rust Kubernetes client and controller runtime
https://kube.rs
Apache License 2.0
3.05k stars 318 forks source link

Fix errors and warnings for the `.reflect_shared()` example #1625

Closed nightkr closed 3 weeks ago

nightkr commented 3 weeks ago

Doesn't compile with the & (nonsense both type-wise and lifetime-wise), might as well fix the other warnings while at it. Also moved the subscription into a concurrent task since it's unreachable otherwise.

Also not sure about whether we want to add a tracing init too.. on one hand it's kind of tangential to the main thing being demonstrated, on the other hand it's easy to get confused by the empty output if you're not used to how tracing works.

Discovered while looking into https://discord.com/channels/500028886025895936/1302071483585269771.

codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 75.3%. Comparing base (a0fcd1e) to head (71de1bd). Report is 3 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1625 +/- ## ===================================== Coverage 75.3% 75.3% ===================================== Files 82 82 Lines 7344 7344 ===================================== Hits 5528 5528 Misses 1816 1816 ``` | [Files with missing lines](https://app.codecov.io/gh/kube-rs/kube/pull/1625?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kube-rs) | Coverage Δ | | |---|---|---| | [kube-runtime/src/utils/watch\_ext.rs](https://app.codecov.io/gh/kube-rs/kube/pull/1625?src=pr&el=tree&filepath=kube-runtime%2Fsrc%2Futils%2Fwatch_ext.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kube-rs#diff-a3ViZS1ydW50aW1lL3NyYy91dGlscy93YXRjaF9leHQucnM=) | `22.3% <ø> (ø)` | |