-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
✨ Introduce CEL for ClusterClass Variables #9239
Conversation
Hi @chaunceyjiang. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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/test-infra repository. |
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.
/ok-to-test
Looks like you'll need to regenerate the associated files |
@killianmuldoon Hello, may I ask if we want to separate the API from its implementation into two PRs or keep them in one PR? |
Best to keep them in the one PR IMO - but maybe keep them to seperate commits. You might want to wait for thorough reviews of the API initially to ensure the implementation doesn't need to be changed regularly. |
@chaunceyjiang: The specified target(s) for
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/test-infra repository. |
3c0f205
to
f3ef3b7
Compare
@killianmuldoon @sbueringer Hi, The API part is ready for review. |
I'd also favour the same PR but 2 commits. @chaunceyjiang - it might be worth marking this as WIP if there will be a second commit with the implementation. |
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.
This will be really useful 🎉
+1 to just one PR. Just that we don't end up with an API without implementation (assuming the PR doesn't become huge) Will try to review soon, but my PR backlog is just too big right now |
Excited to see this PR land (with implementation)! @chaunceyjiang Anything I can do to help out? |
@jimmidyson Hi, thank you very much. I am waiting for the API parts review. Once there is an LGTM, I will start implementing it. Can you help review the API part? |
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.
A few comments, but overall looks good to me, nice work. I think there could be some changes once we get to integrating the CEL validation so I also like the idea of implementation as another commit in this PR rather than as a follow-up.
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.
Did a first review, while we probably want to refine the godoc a bit later I think the current state (+ fixes for the findings) is easily good enough to start the implementation. I would focus on implementing the validation functionality for variables.
In a later step / PR we can introduce additional validation in the ClusterClass webhook for the new fields in the ClusterClass
@chaunceyjiang Any news on this PR? Great work so far btw! |
@jimmidyson I am very sorry for delaying this PR. In the following time, I will continue to complete this PR. |
/lgtm |
LGTM label has been added. Git tree hash: 0b5403bd2eea4ce494489fc5cff3315eed8663da
|
/test pull-cluster-api-e2e-conformance-ci-latest-main |
Thx everyone so far, really nice work :) /assign @chrischdi @fabriziopandini |
@chaunceyjiang: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
/test pull-cluster-api-e2e-mink8s-main |
@chaunceyjiang @jimmidyson @sbueringer awesome work! /lgtm |
if len(validationErrors) > 0 { | ||
for _, validationError := range validationErrors { | ||
// Add context to the error message. | ||
validationError.Detail = fmt.Sprintf("failed to convert schema definition for variable %q; ClusterClass should be checked: %s", clusterClassVariable.Name, validationError.Detail) // TODO: consider if to add ClusterClass name |
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.
Should we resolve this todo or remove it before merging? (Same below)
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.
Nope, it's a copy & paste from a lot of other places (has been there since forever). Let's solve this independently
} | ||
|
||
return allErrs | ||
} | ||
|
||
// The following funcs are all duplicated from upstream CRD validation at | ||
// https://github.com/kubernetes/apiextensions-apiserver/blob/v0.30.0/pkg/apis/apiextensions/validation/validation.go#L1317. |
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.
nit: line number for the link does not seem to be correct :-)
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.
// https://github.com/kubernetes/apiextensions-apiserver/blob/v0.30.0/pkg/apis/apiextensions/validation/validation.go#L1317. | |
// https://github.com/kubernetes/apiextensions-apiserver/blob/v0.30.0/pkg/apis/apiextensions/validation/validation.go#L107. |
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 get rid of the line number. These are copied from all over this file
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.
I'll take this as a follow-up. I have a few follow-up PRs queued up anyway
Really awesome work! just two nits from my side, but also okay for me to handle them in a follow-up :-) |
/approve /hold |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chrischdi 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 |
Thx! Again, really great work everyone!! /hold cancel |
Thank you for all the help getting this in, especially to @sbueringer who has been a superstar in reviewing, guiding, and getting improvements/fixes in 🙏 |
Thx, appreciate it 😃 |
What this PR does / why we need it:
Introduce CEL for ClusterClass Variables.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Part of : #8565
/area clusterclass