Skip to content

Commit f454a71

Browse files
aamoyelAlan Amoyel
authored andcommitted
chore: use CEL validation for KubevirtClusterTemplate instead of webhook
1 parent c29fe33 commit f454a71

File tree

3 files changed

+1
-79
lines changed

3 files changed

+1
-79
lines changed

api/v1alpha1/kubevirtclustertemplate_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ type KubevirtClusterTemplateSpec struct {
3434

3535
// +kubebuilder:object:root=true
3636
// +kubebuilder:resource:path=kubevirtclustertemplates,scope=Namespaced,categories=cluster-api,shortName=kct
37+
// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="KubevirtClusterTemplate is immutable"
3738

3839
// KubevirtClusterTemplate is the Schema for the kubevirtclustertemplates API.
3940
type KubevirtClusterTemplate struct {
4041
metav1.TypeMeta `json:",inline"`
4142
metav1.ObjectMeta `json:"metadata,omitempty"`
42-
4343
Spec KubevirtClusterTemplateSpec `json:"spec,omitempty"`
4444
}
4545

api/v1alpha1/kubevirtclustertemplate_webhook.go

Lines changed: 0 additions & 57 deletions
This file was deleted.

config/webhook/manifests.yaml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,6 @@ metadata:
66
creationTimestamp: null
77
name: validating-webhook-configuration
88
webhooks:
9-
- admissionReviewVersions:
10-
- v1beta1
11-
clientConfig:
12-
service:
13-
name: webhook-service
14-
namespace: system
15-
path: /validate-infrastructure-cluster-x-k8s-io-v1alpha1-kubevirtclustertemplate
16-
failurePolicy: Fail
17-
matchPolicy: Equivalent
18-
name: validation.kubevirtclustertemplate.infrastructure.cluster.x-k8s.io
19-
rules:
20-
- apiGroups:
21-
- infrastructure.cluster.x-k8s.io
22-
apiVersions:
23-
- v1alpha1
24-
operations:
25-
- CREATE
26-
- UPDATE
27-
resources:
28-
- kubevirtclustertemplates
29-
sideEffects: None
309
- admissionReviewVersions:
3110
- v1beta1
3211
clientConfig:

0 commit comments

Comments
 (0)