mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-10-31 02:08:13 +00:00 
			
		
		
		
	Merge pull request #87781 from caesarxuchao/fix-webhook-image-bugs
Only set admission review reponse patch type if the patch is not empty
This commit is contained in:
		| @@ -97,8 +97,10 @@ func mutateConfigmaps(ar v1.AdmissionReview) *v1.AdmissionResponse { | ||||
| 		reviewResponse.Patch = []byte(configMapPatch2) | ||||
| 	} | ||||
|  | ||||
| 	if len(reviewResponse.Patch) != 0 { | ||||
| 		pt := v1.PatchTypeJSONPatch | ||||
| 		reviewResponse.PatchType = &pt | ||||
| 	} | ||||
|  | ||||
| 	return &reviewResponse | ||||
| } | ||||
|   | ||||
| @@ -56,8 +56,10 @@ func mutateCustomResource(ar v1.AdmissionReview) *v1.AdmissionResponse { | ||||
| 	if cr.Data["mutation-stage-1"] == "yes" { | ||||
| 		reviewResponse.Patch = []byte(customResourcePatch2) | ||||
| 	} | ||||
| 	if len(reviewResponse.Patch) != 0 { | ||||
| 		pt := v1.PatchTypeJSONPatch | ||||
| 		reviewResponse.PatchType = &pt | ||||
| 	} | ||||
| 	return &reviewResponse | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Kubernetes Prow Robot
					Kubernetes Prow Robot