Handle the existence or not of the preflight_ prefix in rego#59
Handle the existence or not of the preflight_ prefix in rego#59jetstack-bot merged 2 commits intojetstack:masterfrom j-fuentes:prefix
preflight_ prefix in rego#59Conversation
Signed-off-by: Jose Fuentes <jsfuentescastillo@gmail.com>
Signed-off-by: Jose Fuentes <jsfuentescastillo@gmail.com>
|
/approve Can lgtm too but was going to let @wwwil have a look. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: charlieegan3, j-fuentes The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
|
||
| func ruleToResult(ruleID string) string { | ||
| return fmt.Sprintf("preflight_%s", strings.ReplaceAll(ruleID, ".", "_")) | ||
| return strings.ReplaceAll(ruleID, ".", "_") |
There was a problem hiding this comment.
Isn't this unnecessary now as rule IDs are required to be valid Rego names?
There was a problem hiding this comment.
They are not strictly required though.
We check that in the linter, which flags recommendations but, at least for now, we don't impose those rules.
If at some point we want to impose them, we would run those checks at the beginning of the execution of Preflight.
There was a problem hiding this comment.
Yeah, I feel that we should be enforcing it. I think packages should be linted when they are loaded as part of a preflight check and packages that fail should be ignored. This PR is probably not the place to make that change though.
|
/lgtm |
This allows the
preflight_to exist or not if the schema version of the package is lower than "0.1.0". It assumes the artificial prefix does not exist if the schema version is higher than "0.1.0".Related: #27