-
-
Notifications
You must be signed in to change notification settings - Fork 15
Maybe get_recommended_labels should take a struct of named arguments #491
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
Comments
I actually kind of think even just doing the easy "struct of |
A struct would be an improvement because the field names help to assign the correct values and the struct can be reused so that repetition is reduced. I had a more elaborate solution in mind where you just pass the cluster spec and a "controller spec" where the recommended labels are derived from. The But after a closer look, the implementation of my solution is not as straight forward as I hoped. So I am also fine with the easy struct solution. |
Is there much further refinement planned here then? |
We could still use a trait instead of a struct and then in the trait we could implement functions like the But it's not a strong opinion |
I just asked Sigi and he said a Trait might be nice, but he'd leave it up to the implementor. |
I've added 2 acceptance criteria |
The description does not really talk about the solution but the details are in the comments so I'm fine with it. |
The current list of string arguments is confusing to follow (especially if you don't use rust-analyzer with parameter inlays), and is confusing and error-prone to update in operators when new arguments are added (often in the middle of the list).
This PR adds another parameter to the list: https://github.com/stackabletech/operator-rs/pull/492/files#diff-f3a8a77aa3434fb4aef8eb9c3d011832fc27301972b9975aa303832c3ed33675 Clippy also complains about the many parameters.
This is the function in its current state: https://github.com/stackabletech/operator-rs/blob/main/src/labels.rs#L22
Acceptance criteria:
The text was updated successfully, but these errors were encountered: