-
Notifications
You must be signed in to change notification settings - Fork 63
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 KubevirtClusterTemplate resource to support ClusterClass feature #251
Conversation
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 made a change on this line cause when you use ClusterClass and KubevirtClusterTemplate, the final KubevirtCluster has prefix like a replicaset (eg: cluster-xpejq). The real kubeconfig was created with the "Cluster" resource name by the CAPI Control Plane controller.
/ok-to-test |
Pull Request Test Coverage Report for Build 5985539652
💛 - Coveralls |
@davidvossel note, this is an alpha feature of CAPI, any objections to support it in CAPK at this time? |
/lgtm |
pkg/loadbalancer/loadbalancer.go
Outdated
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.
Like the Workload Cluster, we need to use the cluster name for LB metadata.name cause KubevirtCluster add a prefix on kubevirtCluster ressource when ClusterClass and KubevirtClusterTemplate is used.
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.
hey, I haven't looked deeply at the ClusterClass feature, but this api seems fine.
The only part I question is why we need a validating webhook to ensure this template remains immutable after creation. Can't we express immutability using the crd CEL validation?
|
||
Spec KubevirtClusterTemplateSpec `json:"spec,omitempty"` |
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.
could we add something like the validation below to ensure immutability without needing a webhook?
// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="spec is immutable"
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.
Hello David, thx for your review :) .
I didn't know it was possible to enforce CRD Immutability with CEL Rules, thanks for the advice. I will update my PR to match your specification.
/hold github action CI didn't run yet. |
/hold cancel |
/hold The ci was not run yet |
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aamoyel, davidvossel 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 |
oh? I see that the e2e integration test passed. What else are we waiting on? |
Unit tests, linters, check-gen, etc. Admins should see the "Approve and Test" button. Clicking on it will enable these tests |
|
Can you replay tests please @agradouski @davidvossel ? |
/unhold Thanks @aamoyel ! |
/lgtm |
Fix: #250