-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is an initial PoC to show how rego.v1 support might look. The main thing I am unsure of is the regorewriter. This could have some issues even with v0 as I understand it. For example, `some x in data.lib` will not be rewritten correctly. Anyone with more knowledge on this component, it'd be interesting to better know how this is used and how it should work when supporting both v0 and v1. The next obvious thing to consider here is that attempting parsing in more than one rego version is not ideal. This is done here since we will not know the source version of the rego until we try to parse it. We might consider something like this to allow users to force GK to use a given version. ``` apiVersion: templates.gatekeeper.sh/v1beta1 kind: ConstraintTemplate metadata: name: k8srequiredlabels spec: crd: spec: names: kind: K8sRequiredLabels validation: # Schema for the `parameters` field openAPIV3Schema: properties: labels: type: array items: type: string targets: - target: admission.k8s.gatekeeper.sh version: v1 rego: | package k8srequiredlabels violation contains {"msg": msg, "details": {"foo": "bar"}} if { ... } ``` Signed-off-by: Charlie Egan <[email protected]>
- Loading branch information
1 parent
9e57a57
commit b776de3
Showing
1,296 changed files
with
37,492 additions
and
98,572 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.