kyverno / policy-reporter-ui

Policy Reporter UI
https://kyverno.github.io/policy-reporter-docs/policy-reporter-ui/introduction.html
Apache License 2.0
33 stars 7 forks source link

More flexible options around customBoard namespace selection #422

Open nabadger opened 3 weeks ago

nabadger commented 3 weeks ago

Related to https://kyverno.github.io/policy-reporter-docs/policy-reporter-ui/custom-boards.html#namespace-selector

Currently I get the following response from the UI when no namespaces are specified

No configured namespaces are found

    customBoards:
        [
          {
            name: 'My Custom Board',
            clusterScope: { enabled: false },
            sources: {
              list: ['Trivy Vulnerability'],
            },
            namespaces: {}
          },
        ],

I'm not sure selectors at the moment are powerful enough since I don't think they let me select multiple values with the same key. In our case we don't have a single label selector that is applied to all namespaces (seems overkill to add it just for this purpose).

Something like https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#set-based-requirement would be ideal here I think...

Failing that, shouldn't the default show all namespaces rather than the "No configured namespaces are found" response?

fjogeleit commented 1 day ago

Sorry for the late response.

So I recently added support for more "operations":

https://github.com/kyverno/policy-reporter/blob/main/charts/policy-reporter/values.yaml#L932

So you can check if an label exists - independent of the value. You can check for a list of values or if a label does not exist. Does this help with your issue?