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

Add a PartialEq implementation to generated types #53

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

blinsay
Copy link
Contributor

@blinsay blinsay commented Sep 3, 2024

Here's a quick attempt at adding PartialEq to gateway type implementations for #52. I tried adding Eq as well, but it looks like ObjectMeta and friends don't actually implement Eq.

error[E0277]: the trait bound `ObjectMeta: Eq` is not satisfied
   --> gateway-api/src/apis/standard/gatewayclasses.rs:16:5
    |
16  |     CustomResource, Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq, Eq,
    |     ^^^^^^^^^^^^^^ the trait `Eq` is not implemented for `ObjectMeta`

To make these changes, I updated update.sh and the generate enums xtask to include auto-deriving PartialEq where I could and regenerated with a fresh install of kopium.

$ kopium --version
kopium 0.20.1

@shaneutt
Copy link
Member

shaneutt commented Sep 4, 2024

Thanks for adding this! Please note you'll just need to sign off on commits in the kube-rs org (more details here).

@blinsay
Copy link
Contributor Author

blinsay commented Sep 4, 2024

Please note you'll just need to sign off on commits in the kube-rs org

done!

Copy link
Member

@shaneutt shaneutt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, let's start with this and maybe later we can dig in further on Eq for ObjectMeta. Thank you!

@shaneutt shaneutt merged commit 57380ca into kube-rs:main Sep 4, 2024
2 checks passed
@shaneutt shaneutt linked an issue Sep 4, 2024 that may be closed by this pull request
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.

Equality for CRDs
2 participants