Skip to content

Commit 7c63d3c

Browse files
authored
use capi naming convention for webhooks, update admissionReviewVersions for all webhooks (#393)
1 parent 3ab23ab commit 7c63d3c

File tree

6 files changed

+21
-15
lines changed

6 files changed

+21
-15
lines changed

api/v1alpha1/linodecluster_webhook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ func (r *LinodeCluster) SetupWebhookWithManager(mgr ctrl.Manager) error {
4242
Complete()
4343
}
4444

45-
// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable updation and deletion validation.
46-
//+kubebuilder:webhook:path=/validate-infrastructure-cluster-x-k8s-io-v1alpha1-linodecluster,mutating=false,failurePolicy=fail,sideEffects=None,groups=infrastructure.cluster.x-k8s.io,resources=linodeclusters,verbs=create,versions=v1alpha1,name=vlinodecluster.kb.io,admissionReviewVersions=v1
45+
// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable update and deletion validation.
46+
//+kubebuilder:webhook:path=/validate-infrastructure-cluster-x-k8s-io-v1alpha1-linodecluster,mutating=false,failurePolicy=fail,sideEffects=None,groups=infrastructure.cluster.x-k8s.io,resources=linodeclusters,verbs=create,versions=v1alpha1,name=validation.linodecluster.infrastructure.cluster.x-k8s.io,admissionReviewVersions=v1;v1alpha1
4747

4848
var _ webhook.Validator = &LinodeCluster{}
4949

api/v1alpha1/linodemachine_webhook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ func (r *LinodeMachine) SetupWebhookWithManager(mgr ctrl.Manager) error {
6262

6363
// TODO(user): EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
6464

65-
// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable updation and deletion validation.
66-
//+kubebuilder:webhook:path=/validate-infrastructure-cluster-x-k8s-io-v1alpha1-linodemachine,mutating=false,failurePolicy=fail,sideEffects=None,groups=infrastructure.cluster.x-k8s.io,resources=linodemachines,verbs=create,versions=v1alpha1,name=vlinodemachine.kb.io,admissionReviewVersions=v1
65+
// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable update and deletion validation.
66+
//+kubebuilder:webhook:path=/validate-infrastructure-cluster-x-k8s-io-v1alpha1-linodemachine,mutating=false,failurePolicy=fail,sideEffects=None,groups=infrastructure.cluster.x-k8s.io,resources=linodemachines,verbs=create,versions=v1alpha1,name=validation.linodemachine.infrastructure.cluster.x-k8s.io,admissionReviewVersions=v1;v1alpha1
6767

6868
var _ webhook.Validator = &LinodeMachine{}
6969

api/v1alpha1/linodeobjectstoragebucket_webhook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ func (r *LinodeObjectStorageBucket) SetupWebhookWithManager(mgr ctrl.Manager) er
4949
Complete()
5050
}
5151

52-
// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable updation and deletion validation.
53-
//+kubebuilder:webhook:path=/validate-infrastructure-cluster-x-k8s-io-v1alpha1-linodeobjectstoragebucket,mutating=false,failurePolicy=fail,sideEffects=None,groups=infrastructure.cluster.x-k8s.io,resources=linodeobjectstoragebuckets,verbs=create,versions=v1alpha1,name=vlinodeobjectstoragebucket.kb.io,admissionReviewVersions=v1
52+
// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable update and deletion validation.
53+
//+kubebuilder:webhook:path=/validate-infrastructure-cluster-x-k8s-io-v1alpha1-linodeobjectstoragebucket,mutating=false,failurePolicy=fail,sideEffects=None,groups=infrastructure.cluster.x-k8s.io,resources=linodeobjectstoragebuckets,verbs=create,versions=v1alpha1,name=validation.linodeobjectstoragebucket.infrastructure.cluster.x-k8s.io,admissionReviewVersions=v1;v1alpha1
5454

5555
var _ webhook.Validator = &LinodeObjectStorageBucket{}
5656

api/v1alpha1/linodevpc_webhook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ func (r *LinodeVPC) SetupWebhookWithManager(mgr ctrl.Manager) error {
8181
Complete()
8282
}
8383

84-
// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable updation and deletion validation.
85-
//+kubebuilder:webhook:path=/validate-infrastructure-cluster-x-k8s-io-v1alpha1-linodevpc,mutating=false,failurePolicy=fail,sideEffects=None,groups=infrastructure.cluster.x-k8s.io,resources=linodevpcs,verbs=create,versions=v1alpha1,name=vlinodevpc.kb.io,admissionReviewVersions=v1
84+
// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable update and deletion validation.
85+
//+kubebuilder:webhook:path=/validate-infrastructure-cluster-x-k8s-io-v1alpha1-linodevpc,mutating=false,failurePolicy=fail,sideEffects=None,groups=infrastructure.cluster.x-k8s.io,resources=linodevpcs,verbs=create,versions=v1alpha1,name=validation.linodevpc.infrastructure.cluster.x-k8s.io,admissionReviewVersions=v1;v1alpha1
8686

8787
var _ webhook.Validator = &LinodeVPC{}
8888

api/v1alpha2/linodecluster_webhook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ func (r *LinodeCluster) SetupWebhookWithManager(mgr ctrl.Manager) error {
4242
Complete()
4343
}
4444

45-
// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable updation and deletion validation.
46-
//+kubebuilder:webhook:path=/validate-infrastructure-cluster-x-k8s-io-v1alpha2-linodecluster,mutating=false,failurePolicy=fail,sideEffects=None,groups=infrastructure.cluster.x-k8s.io,resources=linodeclusters,verbs=create,versions=v1alpha2,name=vlinodecluster.kb.io,admissionReviewVersions=v1
45+
// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable update and deletion validation.
46+
//+kubebuilder:webhook:path=/validate-infrastructure-cluster-x-k8s-io-v1alpha2-linodecluster,mutating=false,failurePolicy=fail,sideEffects=None,groups=infrastructure.cluster.x-k8s.io,resources=linodeclusters,verbs=create,versions=v1alpha2,name=validation.linodecluster.infrastructure.cluster.x-k8s.io,admissionReviewVersions=v1;v1alpha1;v1alpha2
4747

4848
var _ webhook.Validator = &LinodeCluster{}
4949

config/webhook/manifests.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ metadata:
66
webhooks:
77
- admissionReviewVersions:
88
- v1
9+
- v1alpha1
10+
- v1alpha2
911
clientConfig:
1012
service:
1113
name: webhook-service
1214
namespace: system
1315
path: /validate-infrastructure-cluster-x-k8s-io-v1alpha2-linodecluster
1416
failurePolicy: Fail
15-
name: vlinodecluster.kb.io
17+
name: validation.linodecluster.infrastructure.cluster.x-k8s.io
1618
rules:
1719
- apiGroups:
1820
- infrastructure.cluster.x-k8s.io
@@ -25,13 +27,14 @@ webhooks:
2527
sideEffects: None
2628
- admissionReviewVersions:
2729
- v1
30+
- v1alpha1
2831
clientConfig:
2932
service:
3033
name: webhook-service
3134
namespace: system
3235
path: /validate-infrastructure-cluster-x-k8s-io-v1alpha1-linodecluster
3336
failurePolicy: Fail
34-
name: vlinodecluster.kb.io
37+
name: validation.linodecluster.infrastructure.cluster.x-k8s.io
3538
rules:
3639
- apiGroups:
3740
- infrastructure.cluster.x-k8s.io
@@ -44,13 +47,14 @@ webhooks:
4447
sideEffects: None
4548
- admissionReviewVersions:
4649
- v1
50+
- v1alpha1
4751
clientConfig:
4852
service:
4953
name: webhook-service
5054
namespace: system
5155
path: /validate-infrastructure-cluster-x-k8s-io-v1alpha1-linodemachine
5256
failurePolicy: Fail
53-
name: vlinodemachine.kb.io
57+
name: validation.linodemachine.infrastructure.cluster.x-k8s.io
5458
rules:
5559
- apiGroups:
5660
- infrastructure.cluster.x-k8s.io
@@ -63,13 +67,14 @@ webhooks:
6367
sideEffects: None
6468
- admissionReviewVersions:
6569
- v1
70+
- v1alpha1
6671
clientConfig:
6772
service:
6873
name: webhook-service
6974
namespace: system
7075
path: /validate-infrastructure-cluster-x-k8s-io-v1alpha1-linodeobjectstoragebucket
7176
failurePolicy: Fail
72-
name: vlinodeobjectstoragebucket.kb.io
77+
name: validation.linodeobjectstoragebucket.infrastructure.cluster.x-k8s.io
7378
rules:
7479
- apiGroups:
7580
- infrastructure.cluster.x-k8s.io
@@ -82,13 +87,14 @@ webhooks:
8287
sideEffects: None
8388
- admissionReviewVersions:
8489
- v1
90+
- v1alpha1
8591
clientConfig:
8692
service:
8793
name: webhook-service
8894
namespace: system
8995
path: /validate-infrastructure-cluster-x-k8s-io-v1alpha1-linodevpc
9096
failurePolicy: Fail
91-
name: vlinodevpc.kb.io
97+
name: validation.linodevpc.infrastructure.cluster.x-k8s.io
9298
rules:
9399
- apiGroups:
94100
- infrastructure.cluster.x-k8s.io

0 commit comments

Comments
 (0)