openshift / compliance-operator

Operator providing OpenShift cluster compliance checks
Apache License 2.0
110 stars 110 forks source link

Validate that rules in tailored profile are of appropriate type #716

Closed JAORMX closed 3 years ago

JAORMX commented 3 years ago

This PR now validates that the rules added to a tailored profile belong to a relevant type.

As we know, we have the following types:

When building a tailored profile, we want there only to be rules that are gonna be relevant and run as the user expects. Here, you can mix and match the following:

but nothing in between. Platform and Node rules shouldn't mix.

With this validation, users will now see an error in the tailored profile and will not build tailored profiles that don't do what they want.

JAORMX commented 3 years ago

/retest

openshift-ci[bot] commented 3 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JAORMX, jhrozek

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/openshift/compliance-operator/blob/master/OWNERS)~~ [JAORMX,jhrozek] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
openshift-bot commented 3 years ago

/retest-required

Please review the full test history for this PR and help us cut down flakes.