mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Merge pull request #103359 from m14815/commit-21.6.4
Remove Redundant type conversion
This commit is contained in:
commit
1d5349df0c
@ -53,7 +53,7 @@ func NewAdmissionWebhookServer(handler http.Handler) (string, func(), error) {
|
|||||||
// AdmissionWebhookHandler creates a HandlerFunc that decodes/encodes AdmissionReview and performs
|
// AdmissionWebhookHandler creates a HandlerFunc that decodes/encodes AdmissionReview and performs
|
||||||
// given admit function
|
// given admit function
|
||||||
func AdmissionWebhookHandler(t *testing.T, admit func(*v1beta1.AdmissionReview) error) http.HandlerFunc {
|
func AdmissionWebhookHandler(t *testing.T, admit func(*v1beta1.AdmissionReview) error) http.HandlerFunc {
|
||||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
defer r.Body.Close()
|
defer r.Body.Close()
|
||||||
data, err := ioutil.ReadAll(r.Body)
|
data, err := ioutil.ReadAll(r.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -82,7 +82,7 @@ func AdmissionWebhookHandler(t *testing.T, admit func(*v1beta1.AdmissionReview)
|
|||||||
if err := json.NewEncoder(w).Encode(review); err != nil {
|
if err := json.NewEncoder(w).Encode(review); err != nil {
|
||||||
t.Errorf("Marshal of response failed with error: %v", err)
|
t.Errorf("Marshal of response failed with error: %v", err)
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// LocalhostCert was generated from crypto/tls/generate_cert.go with the following command:
|
// LocalhostCert was generated from crypto/tls/generate_cert.go with the following command:
|
||||||
|
Loading…
Reference in New Issue
Block a user