Skip to content

Commit

Permalink
fix: avoid generating empty urs (kyverno#11065)
Browse files Browse the repository at this point in the history
Signed-off-by: ShutingZhao <[email protected]>
  • Loading branch information
realshuting authored Sep 10, 2024
1 parent 32da5c3 commit 1b1b90e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/webhooks/updaterequest/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ func NewGenerator(client versioned.Interface, urInformer kyvernov2informers.Upda

// Apply creates update request resource
func (g *generator) Apply(ctx context.Context, ur kyvernov2.UpdateRequestSpec) error {
if ur.Type == kyvernov2.Generate && len(ur.RuleContext) == 0 {
return nil
}
logger.V(4).Info("apply Update Request", "request", ur)
go g.applyResource(context.TODO(), ur)
return nil
Expand Down

0 comments on commit 1b1b90e

Please sign in to comment.