Skip to content

Commit

Permalink
[Misc] Operator: webhook - Right api version used
Browse files Browse the repository at this point in the history
Get rid of unnecessary beta API usage.
  • Loading branch information
Pavan-SAP committed Oct 31, 2024
1 parent e93f322 commit 52c9b9f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmd/web-hooks/internal/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/sap/cap-operator/pkg/client/clientset/versioned"
"golang.org/x/exp/slices"
admissionv1 "k8s.io/api/admission/v1"
"k8s.io/api/admission/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -698,10 +697,10 @@ func getAdmissionRequestFromBytes(w http.ResponseWriter, body []byte) *admission

func prepareResponse(w http.ResponseWriter, admissionReview *admissionv1.AdmissionReview, validation validateResource) []byte {
// prepare response object
finalizedAdmissionReview := v1beta1.AdmissionReview{}
finalizedAdmissionReview := admissionv1.AdmissionReview{}
finalizedAdmissionReview.Kind = admissionReview.Kind
finalizedAdmissionReview.APIVersion = admissionReview.APIVersion
finalizedAdmissionReview.Response = &v1beta1.AdmissionResponse{
finalizedAdmissionReview.Response = &admissionv1.AdmissionResponse{
UID: admissionReview.Request.UID,
Allowed: validation.allowed,
}
Expand Down

0 comments on commit 52c9b9f

Please sign in to comment.