Skip to content

Commit 3bc0c08

Browse files
committed
1 parent 0359b94 commit 3bc0c08

4 files changed

+30
-24
lines changed

api/v1beta3/cloudstackcluster_webhook.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,20 @@ func (r *CloudStackCluster) SetupWebhookWithManager(mgr ctrl.Manager) error {
3838
Complete()
3939
}
4040

41-
//+kubebuilder:webhook:path=/mutate-infrastructure-cluster-x-k8s-io-v1beta3-cloudstackcluster,mutating=true,failurePolicy=fail,sideEffects=None,groups=infrastructure.cluster.x-k8s.io,resources=cloudstackclusters,verbs=create;update,versions=v1beta3,name=mcloudstackcluster.kb.io,admissionReviewVersions=v1;v1beta1
41+
// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta3-cloudstackcluster,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=cloudstackclusters,versions=v1beta3,name=validation.cloudstackcluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
42+
// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta3-cloudstackcluster,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=cloudstackclusters,versions=v1beta3,name=default.cloudstackcluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
4243

43-
var _ webhook.Defaulter = &CloudStackCluster{}
44+
var (
45+
_ webhook.Defaulter = &CloudStackCluster{}
46+
_ webhook.Validator = &CloudStackCluster{}
47+
)
4448

4549
// Default implements webhook.Defaulter so a webhook will be registered for the type
4650
func (r *CloudStackCluster) Default() {
4751
cloudstackclusterlog.V(1).Info("entered api default setting webhook", "api resource name", r.Name)
4852
// No defaulted values supported yet.
4953
}
5054

51-
// +kubebuilder:webhook:name=vcloudstackcluster.kb.io,groups=infrastructure.cluster.x-k8s.io,resources=cloudstackclusters,versions=v1beta3,verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta3-cloudstackcluster,mutating=false,failurePolicy=fail,sideEffects=None,admissionReviewVersions=v1;v1beta1
52-
53-
var _ webhook.Validator = &CloudStackCluster{}
54-
5555
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
5656
func (r *CloudStackCluster) ValidateCreate() error {
5757
cloudstackclusterlog.V(1).Info("entered validate create webhook", "api resource name", r.Name)

api/v1beta3/cloudstackmachine_webhook.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,20 @@ func (r *CloudStackMachine) SetupWebhookWithManager(mgr ctrl.Manager) error {
3838
Complete()
3939
}
4040

41-
//+kubebuilder:webhook:path=/mutate-infrastructure-cluster-x-k8s-io-v1beta3-cloudstackmachine,mutating=true,failurePolicy=fail,sideEffects=None,groups=infrastructure.cluster.x-k8s.io,resources=cloudstackmachines,verbs=create;update,versions=v1beta3,name=mcloudstackmachine.kb.io,admissionReviewVersions=v1;v1beta1
41+
// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta3-cloudstackmachine,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=cloudstackmachines,versions=v1beta3,name=validation.cloudstackmachine.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
42+
// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta3-cloudstackmachine,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=cloudstackmachines,versions=v1beta3,name=default.cloudstackmachine.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
4243

43-
var _ webhook.Defaulter = &CloudStackMachine{}
44+
var (
45+
_ webhook.Defaulter = &CloudStackMachine{}
46+
_ webhook.Validator = &CloudStackMachine{}
47+
)
4448

4549
// Default implements webhook.Defaulter so a webhook will be registered for the type
4650
func (r *CloudStackMachine) Default() {
4751
cloudstackmachinelog.V(1).Info("entered api default setting webhook, no defaults to set", "api resource name", r.Name)
4852
// No defaulted values supported yet.
4953
}
5054

51-
//+kubebuilder:webhook:path=/validate-infrastructure-cluster-x-k8s-io-v1beta3-cloudstackmachine,mutating=false,failurePolicy=fail,sideEffects=None,groups=infrastructure.cluster.x-k8s.io,resources=cloudstackmachines,verbs=create;update,versions=v1beta3,name=vcloudstackmachine.kb.io,admissionReviewVersions=v1;v1beta1
52-
53-
var _ webhook.Validator = &CloudStackMachine{}
54-
5555
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
5656
func (r *CloudStackMachine) ValidateCreate() error {
5757
cloudstackmachinelog.V(1).Info("entered validate create webhook", "api resource name", r.Name)

api/v1beta3/cloudstackmachinetemplate_webhook.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,20 @@ func (r *CloudStackMachineTemplate) SetupWebhookWithManager(mgr ctrl.Manager) er
3939
Complete()
4040
}
4141

42-
// +kubebuilder:webhook:path=/mutate-infrastructure-cluster-x-k8s-io-v1beta3-cloudstackmachinetemplate,mutating=true,failurePolicy=fail,sideEffects=None,groups=infrastructure.cluster.x-k8s.io,resources=cloudstackmachinetemplates,verbs=create;update,versions=v1beta3,name=mcloudstackmachinetemplate.kb.io,admissionReviewVersions=v1;v1beta1
42+
// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta3-cloudstackmachinetemplate,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=cloudstackmachinetemplates,versions=v1beta3,name=validation.cloudstackmachinetemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
43+
// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta3-cloudstackmachinetemplate,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=cloudstackmachinetemplates,versions=v1beta3,name=default.cloudstackmachinetemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
4344

44-
var _ webhook.Defaulter = &CloudStackMachineTemplate{}
45+
var (
46+
_ webhook.Defaulter = &CloudStackMachineTemplate{}
47+
_ webhook.Validator = &CloudStackMachineTemplate{}
48+
)
4549

4650
// Default implements webhook.Defaulter so a webhook will be registered for the type
4751
func (r *CloudStackMachineTemplate) Default() {
4852
cloudstackmachinetemplatelog.V(1).Info("entered default setting webhook", "api resource name", r.Name)
4953
// No defaulted values supported yet.
5054
}
5155

52-
// +kubebuilder:webhook:path=/validate-infrastructure-cluster-x-k8s-io-v1beta3-cloudstackmachinetemplate,mutating=false,failurePolicy=fail,sideEffects=None,groups=infrastructure.cluster.x-k8s.io,resources=cloudstackmachinetemplates,verbs=create;update,versions=v1beta3,name=vcloudstackmachinetemplate.kb.io,admissionReviewVersions=v1;v1beta1
53-
54-
var _ webhook.Validator = &CloudStackMachineTemplate{}
55-
5656
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
5757
func (r *CloudStackMachineTemplate) ValidateCreate() error {
5858
cloudstackmachinetemplatelog.V(1).Info("entered validate create webhook", "api resource name", r.Name)

config/webhook/manifests.yaml

+12-6
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ webhooks:
1414
namespace: system
1515
path: /mutate-infrastructure-cluster-x-k8s-io-v1beta3-cloudstackcluster
1616
failurePolicy: Fail
17-
name: mcloudstackcluster.kb.io
17+
matchPolicy: Equivalent
18+
name: default.cloudstackcluster.infrastructure.cluster.x-k8s.io
1819
rules:
1920
- apiGroups:
2021
- infrastructure.cluster.x-k8s.io
@@ -35,7 +36,8 @@ webhooks:
3536
namespace: system
3637
path: /mutate-infrastructure-cluster-x-k8s-io-v1beta3-cloudstackmachine
3738
failurePolicy: Fail
38-
name: mcloudstackmachine.kb.io
39+
matchPolicy: Equivalent
40+
name: default.cloudstackmachine.infrastructure.cluster.x-k8s.io
3941
rules:
4042
- apiGroups:
4143
- infrastructure.cluster.x-k8s.io
@@ -56,7 +58,8 @@ webhooks:
5658
namespace: system
5759
path: /mutate-infrastructure-cluster-x-k8s-io-v1beta3-cloudstackmachinetemplate
5860
failurePolicy: Fail
59-
name: mcloudstackmachinetemplate.kb.io
61+
matchPolicy: Equivalent
62+
name: default.cloudstackmachinetemplate.infrastructure.cluster.x-k8s.io
6063
rules:
6164
- apiGroups:
6265
- infrastructure.cluster.x-k8s.io
@@ -84,7 +87,8 @@ webhooks:
8487
namespace: system
8588
path: /validate-infrastructure-cluster-x-k8s-io-v1beta3-cloudstackcluster
8689
failurePolicy: Fail
87-
name: vcloudstackcluster.kb.io
90+
matchPolicy: Equivalent
91+
name: validation.cloudstackcluster.infrastructure.cluster.x-k8s.io
8892
rules:
8993
- apiGroups:
9094
- infrastructure.cluster.x-k8s.io
@@ -105,7 +109,8 @@ webhooks:
105109
namespace: system
106110
path: /validate-infrastructure-cluster-x-k8s-io-v1beta3-cloudstackmachine
107111
failurePolicy: Fail
108-
name: vcloudstackmachine.kb.io
112+
matchPolicy: Equivalent
113+
name: validation.cloudstackmachine.infrastructure.cluster.x-k8s.io
109114
rules:
110115
- apiGroups:
111116
- infrastructure.cluster.x-k8s.io
@@ -126,7 +131,8 @@ webhooks:
126131
namespace: system
127132
path: /validate-infrastructure-cluster-x-k8s-io-v1beta3-cloudstackmachinetemplate
128133
failurePolicy: Fail
129-
name: vcloudstackmachinetemplate.kb.io
134+
matchPolicy: Equivalent
135+
name: validation.cloudstackmachinetemplate.infrastructure.cluster.x-k8s.io
130136
rules:
131137
- apiGroups:
132138
- infrastructure.cluster.x-k8s.io

0 commit comments

Comments
 (0)