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

Allow CRD to implement PartialEq trait #242

Merged
merged 3 commits into from
May 21, 2020

Conversation

ctron
Copy link
Contributor

@ctron ctron commented May 20, 2020

This change allows the dervie CustomResource to implement the PartialEq trait.

This helps in creating reconcile loops, checking if the resource has changed while processing. Similar to the DeepEquals on the Golang side.

@clux
Copy link
Member

clux commented May 21, 2020

Yeah, that makes complete sense. Thanks for this.

I think maybe an optimal solution would add PartialEq if the struct itself also tries to derive it, that way we have less #[kube(attrs)] when the crate could perfectly well figure it out, but this solution works fine. Will merge it later in the evening.

@clux clux merged commit 24c929a into kube-rs:master May 21, 2020
@ctron
Copy link
Contributor Author

ctron commented May 22, 2020

Thanks for merging!

I think maybe an optimal solution would add PartialEq if the struct itself also tries to derive it, that way we have less #[kube(attrs)] when the crate could perfectly well figure it out, but this solution works fine.

Yes, I wanted to have this as well. However, I wasn't able to figure out how to get access to the derive macro content while processing CustomResource.

@clux clux mentioned this pull request May 22, 2020
@clux
Copy link
Member

clux commented May 22, 2020

Yeah, not sure either atm (though haven't had time to really look). So have opened an issue around this and how to deal with extra traits in general: #243

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants