Skip to content

Commit

Permalink
skip GRs for spec being same in old and updated policy (#1723)
Browse files Browse the repository at this point in the history
Signed-off-by: NoSkillGirl <singhpooja240393@gmail.com>
  • Loading branch information
NoSkillGirl committed Mar 19, 2021
1 parent 4128410 commit bcc1997
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/generate/generate_controller.go
@@ -1,6 +1,7 @@
package generate

import (
"reflect"
"time"

"github.com/go-logr/logr"
Expand Down Expand Up @@ -175,6 +176,10 @@ func (c *Controller) updatePolicy(old, cur interface{}) {
}
}

if reflect.DeepEqual(curP.Spec, oldP.Spec) {
policyHasGenerate = false
}

if !policyHasGenerate {
return
}
Expand Down

0 comments on commit bcc1997

Please sign in to comment.