-
Notifications
You must be signed in to change notification settings - Fork 109
Description
Hi,
this is a follow-up to issue #1213 (the display bug reported in that issue is now fixed, thx!)
There are still other places in the UI where those skipped resources still show up, though
Example here: in the foo namespace there are 2 service accounts: default and skip-me
I apply a dummy vpol to skip all SAs that are not called default
apiVersion: policies.kyverno.io/v1alpha1
kind: ValidatingPolicy
metadata:
name: dummy-skip-non-default-sa
spec:
validationActions:
- Audit
autogen:
validatingAdmissionPolicy:
enabled: false
evaluation:
background:
enabled: true
matchConstraints:
resourceRules:
- apiGroups: [""]
apiVersions: ["v1"]
resources: ["serviceaccounts"]
operations: ["CREATE","UPDATE"]
matchConditions:
- name: 'skip if non-default'
expression: object.metadata.name == 'default'
validations:
- expression: '0 == 0'
message: 'always pass'I get the expected policyreports
$ kubectl get polr -n foo
NAME KIND NAME PASS FAIL WARN ERROR SKIP AGE
29869038-4922-401b-824c-653d0308a801 ServiceAccount default 1 0 0 0 0 32m
f31148c7-dffc-4b30-a423-53005f2f88ae ServiceAccount skip-me 0 0 0 0 1 32mAs in the other issue I have
sources:
- name: KyvernoValidatingPolicy
type: result
exceptions: false
excludes:
results:
- error
- skipWhat I expect is to see the default service account in the UI, but NOT the skip-me service account. It's still listed in the global "Other" view
Second place where it still appears: I create a NamespaceCustomBoard for that namespace
apiVersion: ui.policyreporter.kyverno.io/v1alpha1
kind: NamespaceCustomBoard
metadata:
name: my-namespacecustomboard
namespace: foo
spec:
title: fooand the skip-me service account is also visible in there
Weird thing: I create another namespaceCustomboard, but with the results display option this time
apiVersion: ui.policyreporter.kyverno.io/v1alpha1
kind: NamespaceCustomBoard
metadata:
name: my-namespacecustomboard-results
namespace: foo
spec:
title: foo-results
display: resultsand there I do not see any of the 2 service accounts
Thanks