-
-
Notifications
You must be signed in to change notification settings - Fork 325
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
More ergonomic ListParams::labels #1386
Comments
Label Selector helper wrappers is something I've kind of wanted for a while myself. Personally I am not sure about a mutably borrowable string here, because that feels equally error-prone. Have you seen what linkerd is doing with actually typed label selector expressions? |
imo it sounds reasonable to override the field completely in a builder pattern, since that would be the case for other non-collection fields as well. Maybe you want a |
Would you like to work on this feature?
yes
What problem are you trying to solve?
If I run:
I'd expect:
labels: Some("a=1, b=2")
but I'm getting:
labels: Some("b=2")
That's because
ListParams::labels
overrides previously set values, which IMO is unexpected behavior in a Builder Pattern.Describe the solution you'd like
Same would apply to
ListParams::fields
andWatchList::{lables,fields}
.This has a caveat of being a "silent" Breaking Change, as the behavior will change, but the API will stay the same.
Describe alternatives you've considered
Introducing a new method which allows chaining, under a different name.
More-or-less a pseudocode:
Documentation, Adoption, Migration Strategy
No response
Target crate for feature
kube-core
The text was updated successfully, but these errors were encountered: