mirror of
https://github.com/kyverno/kyverno.git
synced 2025-04-09 10:42:22 +00:00
fixed attotaions for empty set
This commit is contained in:
parent
9399adeb0f
commit
40b40fb601
1 changed files with 11 additions and 0 deletions
|
@ -302,6 +302,17 @@ func doMatchAndExcludeConflict(rule kyverno.Rule) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
if rule.MatchResources.Annotations != nil && rule.ExcludeResources.Annotations != nil {
|
||||
if !(reflect.DeepEqual(rule.MatchResources.Annotations, rule.ExcludeResources.Annotations)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
if (rule.MatchResources.Annotations == nil && rule.ExcludeResources.Annotations != nil) ||
|
||||
(rule.MatchResources.Annotations != nil && rule.ExcludeResources.Annotations == nil) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue