-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Passing --derive Default
does not derive it for top level custom resource
#232
Comments
Yeah, this is one of those awkward trade-offs with having the top level struct generated by proc macro code; anything you need to customise on the struct must be fed in via attributes, in this case My gut feel is that it is worth taking your change and maybe generalising it for the ones we have listed excluding exceptions that don't work. As far as I can tell, the only clash would be |
@clux Yeah, the only collision I've found was Thanks for taking a look! |
I think what you have is great, formatting is the job of |
When playing around with Kopium I realized that passing
--derive Default
derivesDefault
for child structs, but not the top levelCustomResource
. Adding#kube[(derive="Default")]
worked, but I'm not sure this is desired behavior, since I realize that not every user specified trait on the derive field can be added as a#kube[(derive="TRAIT")]
without conflicts.For example, I had to add a conditional to check if I had tried to derive default. https://github.com/kube-rs/kopium/compare/main...david-rusnak:kopium:feat/add-customresource-default-if-specified?expand=1
Again, not sure this is desired, but thought I'd flag it here in case anyone else was seeing this.
The text was updated successfully, but these errors were encountered: