mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
fixed triggring generate rule (#1355)
This commit is contained in:
parent
673b3bfd22
commit
733cd060a3
1 changed files with 5 additions and 3 deletions
|
@ -104,7 +104,7 @@ type WebhookServer struct {
|
|||
|
||||
auditHandler AuditHandler
|
||||
|
||||
log logr.Logger
|
||||
log logr.Logger
|
||||
|
||||
openAPIController *openapi.Controller
|
||||
|
||||
|
@ -179,7 +179,7 @@ func NewWebhookServer(
|
|||
log: log,
|
||||
openAPIController: openAPIController,
|
||||
supportMutateValidate: supportMutateValidate,
|
||||
resCache: resCache,
|
||||
resCache: resCache,
|
||||
}
|
||||
|
||||
mux := httprouter.New()
|
||||
|
@ -347,7 +347,9 @@ func (ws *WebhookServer) ResourceMutation(request *v1beta1.AdmissionRequest) *v1
|
|||
|
||||
// GENERATE
|
||||
if request.Operation == v1beta1.Create || request.Operation == v1beta1.Update {
|
||||
go ws.HandleGenerate(request.DeepCopy(), generatePolicies, ctx, userRequestInfo, ws.configHandler)
|
||||
newRequest := request.DeepCopy()
|
||||
newRequest.Object.Raw = patchedResource
|
||||
go ws.HandleGenerate(newRequest, generatePolicies, ctx, userRequestInfo, ws.configHandler)
|
||||
}
|
||||
|
||||
patchType := v1beta1.PatchTypeJSONPatch
|
||||
|
|
Loading…
Add table
Reference in a new issue