From 26c0d5cc7564fc40d8b357104be75b4101eb118b Mon Sep 17 00:00:00 2001 From: Prateek Pandey Date: Wed, 7 Apr 2021 21:15:00 +0530 Subject: [PATCH] fix(webhook): fix admission review response apis (#275) (#276) Signed-off-by: prateekpandey14 --- Makefile | 10 +++++----- pkg/webhook/webhook.go | 7 ++++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 18571630..bc3c5ba8 100644 --- a/Makefile +++ b/Makefile @@ -84,11 +84,11 @@ CSTOR_BASE_IMAGE_AMD64= ${IMAGE_ORG}/cstor-base-amd64:${BASE_TAG} export CSTOR_BASE_IMAGE_AMD64 # Specify the name of the docker repo for amd64 -CSPC_OPERATOR_REPO_NAME=cspc-operator-amd64 -CVC_OPERATOR_REPO_NAME=cvc-operator-amd64 -POOL_MANAGER_REPO_NAME=cstor-pool-manager-amd64 -VOLUME_MANAGER_REPO_NAME=cstor-volume-manager-amd64 -CSTOR_WEBHOOK_REPO_NAME=cstor-webhook-amd64 +CSPC_OPERATOR_REPO_NAME=cspc-operator +CVC_OPERATOR_REPO_NAME=cvc-operator +POOL_MANAGER_REPO_NAME=cstor-pool-manager +VOLUME_MANAGER_REPO_NAME=cstor-volume-manager +CSTOR_WEBHOOK_REPO_NAME=cstor-webhook # Specify the directory location of main package after bin directory # e.g. bin/{DIRECTORY_NAME_OF_APP} diff --git a/pkg/webhook/webhook.go b/pkg/webhook/webhook.go index c67b4abc..d6e9c73c 100644 --- a/pkg/webhook/webhook.go +++ b/pkg/webhook/webhook.go @@ -245,7 +245,12 @@ func (wh *webhook) Serve(w http.ResponseWriter, r *http.Request) { } } - admissionReview := v1.AdmissionReview{} + admissionReview := v1.AdmissionReview{ + TypeMeta: metav1.TypeMeta{ + APIVersion: v1.SchemeGroupVersion.String(), + Kind: "AdmissionReview", + }, + } if admissionResponse != nil { admissionReview.Response = admissionResponse if ar.Request != nil {