2019-08-23 18:34:23 -07:00
|
|
|
package policy
|
|
|
|
|
2019-11-13 13:41:08 -08:00
|
|
|
import kyverno "github.com/nirmata/kyverno/pkg/api/kyverno/v1"
|
2019-08-23 18:34:23 -07:00
|
|
|
|
|
|
|
// reEvaulatePolicy checks if the policy needs to be re-evaulated
|
|
|
|
// during re-evaulation we remove all the old policy violations and re-create new ones
|
|
|
|
// - Rule count changes
|
|
|
|
// - Rule resource description changes
|
|
|
|
// - Rule operation changes
|
|
|
|
// - Rule name changed
|
2019-09-03 14:51:51 -07:00
|
|
|
func reEvaulatePolicy(curP, oldP *kyverno.ClusterPolicy) bool {
|
2019-08-23 18:34:23 -07:00
|
|
|
// count of rules changed
|
|
|
|
if len(curP.Spec.Rules) != len(curP.Spec.Rules) {
|
|
|
|
|
|
|
|
}
|
|
|
|
return true
|
|
|
|
}
|