Skip to content

Commit

Permalink
use capi naming convention for webhooks, update admissionReviewVersio…
Browse files Browse the repository at this point in the history
…ns for all webhooks (#393)
  • Loading branch information
rosskirkpat authored Jul 3, 2024
1 parent 3ab23ab commit 7c63d3c
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 15 deletions.
4 changes: 2 additions & 2 deletions api/v1alpha1/linodecluster_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ func (r *LinodeCluster) SetupWebhookWithManager(mgr ctrl.Manager) error {
Complete()
}

// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable updation and deletion validation.
//+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
// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable update and deletion validation.
//+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

var _ webhook.Validator = &LinodeCluster{}

Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/linodemachine_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ func (r *LinodeMachine) SetupWebhookWithManager(mgr ctrl.Manager) error {

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

// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable updation and deletion validation.
//+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
// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable update and deletion validation.
//+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

var _ webhook.Validator = &LinodeMachine{}

Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/linodeobjectstoragebucket_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ func (r *LinodeObjectStorageBucket) SetupWebhookWithManager(mgr ctrl.Manager) er
Complete()
}

// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable updation and deletion validation.
//+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
// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable update and deletion validation.
//+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

var _ webhook.Validator = &LinodeObjectStorageBucket{}

Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/linodevpc_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ func (r *LinodeVPC) SetupWebhookWithManager(mgr ctrl.Manager) error {
Complete()
}

// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable updation and deletion validation.
//+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
// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable update and deletion validation.
//+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

var _ webhook.Validator = &LinodeVPC{}

Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha2/linodecluster_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ func (r *LinodeCluster) SetupWebhookWithManager(mgr ctrl.Manager) error {
Complete()
}

// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable updation and deletion validation.
//+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
// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable update and deletion validation.
//+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

var _ webhook.Validator = &LinodeCluster{}

Expand Down
16 changes: 11 additions & 5 deletions config/webhook/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ metadata:
webhooks:
- admissionReviewVersions:
- v1
- v1alpha1
- v1alpha2
clientConfig:
service:
name: webhook-service
namespace: system
path: /validate-infrastructure-cluster-x-k8s-io-v1alpha2-linodecluster
failurePolicy: Fail
name: vlinodecluster.kb.io
name: validation.linodecluster.infrastructure.cluster.x-k8s.io
rules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
Expand All @@ -25,13 +27,14 @@ webhooks:
sideEffects: None
- admissionReviewVersions:
- v1
- v1alpha1
clientConfig:
service:
name: webhook-service
namespace: system
path: /validate-infrastructure-cluster-x-k8s-io-v1alpha1-linodecluster
failurePolicy: Fail
name: vlinodecluster.kb.io
name: validation.linodecluster.infrastructure.cluster.x-k8s.io
rules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
Expand All @@ -44,13 +47,14 @@ webhooks:
sideEffects: None
- admissionReviewVersions:
- v1
- v1alpha1
clientConfig:
service:
name: webhook-service
namespace: system
path: /validate-infrastructure-cluster-x-k8s-io-v1alpha1-linodemachine
failurePolicy: Fail
name: vlinodemachine.kb.io
name: validation.linodemachine.infrastructure.cluster.x-k8s.io
rules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
Expand All @@ -63,13 +67,14 @@ webhooks:
sideEffects: None
- admissionReviewVersions:
- v1
- v1alpha1
clientConfig:
service:
name: webhook-service
namespace: system
path: /validate-infrastructure-cluster-x-k8s-io-v1alpha1-linodeobjectstoragebucket
failurePolicy: Fail
name: vlinodeobjectstoragebucket.kb.io
name: validation.linodeobjectstoragebucket.infrastructure.cluster.x-k8s.io
rules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
Expand All @@ -82,13 +87,14 @@ webhooks:
sideEffects: None
- admissionReviewVersions:
- v1
- v1alpha1
clientConfig:
service:
name: webhook-service
namespace: system
path: /validate-infrastructure-cluster-x-k8s-io-v1alpha1-linodevpc
failurePolicy: Fail
name: vlinodevpc.kb.io
name: validation.linodevpc.infrastructure.cluster.x-k8s.io
rules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
Expand Down

0 comments on commit 7c63d3c

Please sign in to comment.