-
Notifications
You must be signed in to change notification settings - Fork 1.4k
⚠️ Drop unnecessary fields from ClusterClass template references #12358
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
⚠️ Drop unnecessary fields from ClusterClass template references #12358
Conversation
@fabriziopandini: The
The following commands are available to trigger optional jobs:
Use
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/test pull-cluster-api-e2e-conformance-ci-latest-main |
/test pull-cluster-api-e2e-conformance-ci-latest-main |
/test pull-cluster-api-e2e-conformance-ci-latest-main |
dc364d2
to
ca3719e
Compare
/test pull-cluster-api-e2e-conformance-ci-latest-main |
@JoelSpeed @sbueringer comments should be addressed. |
Thank you!! /lgtm |
LGTM label has been added. Git tree hash: 8aa20659570aee3619322cd060bbc24dfb8c22d1
|
/test pull-cluster-api-e2e-main |
// ref is a required reference to a custom resource | ||
// offered by a provider. | ||
// +required | ||
Ref *corev1.ObjectReference `json:"ref"` | ||
Ref *ClusterClassTemplateReference `json:"ref"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given this is required, does it need to be a pointer? I think we could avoid dereferencing complexity
I think the correct thing to do here is
Ref *ClusterClassTemplateReference `json:"ref"` | |
Ref ClusterClassTemplateReference `json:"ref,omitzero"` |
With this, when there's nothing specified within, the field will be omitted from the representation, which will trigger the field to fail a "required" check implemented by the openapi validation on CRDs.
(Assuming we are using Go 1.24?)
Is there something specific we are using a pointer to represent here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's defer this. We're tracking this one in #10852.
I now also linked your comment there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in #12299
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JoelSpeed The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
Another cleanup to keep our API surface as small as clean as we can
Part of #6539
/area clusterclass