From b542f6bd3eb52ad922bb478c90522c491450a15c Mon Sep 17 00:00:00 2001 From: Ellis Tarn Date: Thu, 16 Feb 2023 17:40:07 -0800 Subject: [PATCH] fix: Remove deletion webhooks (#214) --- charts/karpenter-core/templates/webhooks.yaml | 1 - pkg/apis/v1alpha5/provisioner_validation.go | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/charts/karpenter-core/templates/webhooks.yaml b/charts/karpenter-core/templates/webhooks.yaml index 41552a04dc..73fbb53b3d 100644 --- a/charts/karpenter-core/templates/webhooks.yaml +++ b/charts/karpenter-core/templates/webhooks.yaml @@ -55,7 +55,6 @@ webhooks: operations: - CREATE - UPDATE - - DELETE --- apiVersion: admissionregistration.k8s.io/v1 kind: ValidatingWebhookConfiguration diff --git a/pkg/apis/v1alpha5/provisioner_validation.go b/pkg/apis/v1alpha5/provisioner_validation.go index f2e7d5dfa4..3e5a224dea 100644 --- a/pkg/apis/v1alpha5/provisioner_validation.go +++ b/pkg/apis/v1alpha5/provisioner_validation.go @@ -22,6 +22,7 @@ import ( "github.com/samber/lo" "go.uber.org/multierr" + admissionregistrationv1 "k8s.io/api/admissionregistration/v1" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/util/sets" @@ -62,6 +63,13 @@ const ( providerRefPath = "providerRef" ) +func (p *Provisioner) SupportedVerbs() []admissionregistrationv1.OperationType { + return []admissionregistrationv1.OperationType{ + admissionregistrationv1.Create, + admissionregistrationv1.Update, + } +} + func (p *Provisioner) Validate(ctx context.Context) (errs *apis.FieldError) { return errs.Also( apis.ValidateObjectMetadata(p).ViaField("metadata"),