File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
test/images/agnhost/webhook Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -97,8 +97,10 @@ func mutateConfigmaps(ar v1.AdmissionReview) *v1.AdmissionResponse {
97
97
reviewResponse .Patch = []byte (configMapPatch2 )
98
98
}
99
99
100
- pt := v1 .PatchTypeJSONPatch
101
- reviewResponse .PatchType = & pt
100
+ if len (reviewResponse .Patch ) != 0 {
101
+ pt := v1 .PatchTypeJSONPatch
102
+ reviewResponse .PatchType = & pt
103
+ }
102
104
103
105
return & reviewResponse
104
106
}
Original file line number Diff line number Diff line change @@ -56,8 +56,10 @@ func mutateCustomResource(ar v1.AdmissionReview) *v1.AdmissionResponse {
56
56
if cr .Data ["mutation-stage-1" ] == "yes" {
57
57
reviewResponse .Patch = []byte (customResourcePatch2 )
58
58
}
59
- pt := v1 .PatchTypeJSONPatch
60
- reviewResponse .PatchType = & pt
59
+ if len (reviewResponse .Patch ) != 0 {
60
+ pt := v1 .PatchTypeJSONPatch
61
+ reviewResponse .PatchType = & pt
62
+ }
61
63
return & reviewResponse
62
64
}
63
65
You can’t perform that action at this time.
0 commit comments