Skip to content

Commit

Permalink
fixed triggring generate rule (kyverno#1355)
Browse files Browse the repository at this point in the history
  • Loading branch information
NoSkillGirl authored Dec 3, 2020
1 parent 673b3bf commit 733cd06
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/webhooks/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ type WebhookServer struct {

auditHandler AuditHandler

log logr.Logger
log logr.Logger

openAPIController *openapi.Controller

Expand Down Expand Up @@ -179,7 +179,7 @@ func NewWebhookServer(
log: log,
openAPIController: openAPIController,
supportMutateValidate: supportMutateValidate,
resCache: resCache,
resCache: resCache,
}

mux := httprouter.New()
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 733cd06

Please sign in to comment.