Skip to content

Commit

Permalink
fix(webhook): fix admission review response apis (#275) (#276)
Browse files Browse the repository at this point in the history
Signed-off-by: prateekpandey14 <prateek.pandey@mayadata.io>
  • Loading branch information
prateekpandey14 authored Apr 7, 2021
1 parent 0c77e03 commit 26c0d5c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
7 changes: 6 additions & 1 deletion pkg/webhook/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 26c0d5c

Please sign in to comment.