Skip to content

Handle the existence or not of the preflight_ prefix in rego#59

Merged
jetstack-bot merged 2 commits intojetstack:masterfrom
j-fuentes:prefix
Jan 27, 2020
Merged

Handle the existence or not of the preflight_ prefix in rego#59
jetstack-bot merged 2 commits intojetstack:masterfrom
j-fuentes:prefix

Conversation

@j-fuentes
Copy link
Member

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

Signed-off-by: Jose Fuentes <jsfuentescastillo@gmail.com>
Signed-off-by: Jose Fuentes <jsfuentescastillo@gmail.com>
@jetstack-bot jetstack-bot added the dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. label Jan 23, 2020
@jetstack-bot jetstack-bot requested a review from munnerz January 23, 2020 20:36
@jetstack-bot jetstack-bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 23, 2020
@j-fuentes j-fuentes requested review from charlieegan3 and wwwil and removed request for munnerz January 23, 2020 20:36
@charlieegan3
Copy link
Contributor

/approve

Can lgtm too but was going to let @wwwil have a look.

@jetstack-bot
Copy link
Contributor

[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

Details Needs approval from an approver in each of these files:
  • OWNERS [charlieegan3,j-fuentes]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment


func ruleToResult(ruleID string) string {
return fmt.Sprintf("preflight_%s", strings.ReplaceAll(ruleID, ".", "_"))
return strings.ReplaceAll(ruleID, ".", "_")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this unnecessary now as rule IDs are required to be valid Rego names?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@wwwil
Copy link
Member

wwwil commented Jan 27, 2020

/lgtm

@jetstack-bot jetstack-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 27, 2020
@jetstack-bot jetstack-bot merged commit 0f3f9d6 into jetstack:master Jan 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants