Skip to content

Commit acd240d

Browse files
authored
error in applying checkov resource selector (#1606)
When applying a Policy with - spec.constraints.checkov.selector.resource.matchExpressions or - spec.constraints.checkov.selector.resource.matchLabels the filters are totally ignored with namespace selector properly works. Signed-off-by: daniele strollo <[email protected]>
1 parent 2a00adf commit acd240d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/utils/policies/find.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func FindMatchingPolicy(
100100

101101
// @step: if we have a resource selector lets check it
102102
if list.Items[i].Spec.Constraints.Checkov.Selector.Resource != nil {
103-
selector, err := metav1.LabelSelectorAsSelector(list.Items[i].Spec.Constraints.Checkov.Selector.Namespace)
103+
selector, err := metav1.LabelSelectorAsSelector(list.Items[i].Spec.Constraints.Checkov.Selector.Resource)
104104
if err != nil {
105105
return nil, err
106106
}

0 commit comments

Comments
 (0)