Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(webhook): fix admission review response order #275

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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