mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Remove Redundant type conversion
This commit is contained in:
		@@ -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:
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user