Skip to content

Commit d82cbe1

Browse files
authored
Add multi-engine support (#293)
* Add multi-engine support Signed-off-by: Max Smythe <[email protected]> * Address review comments Signed-off-by: Max Smythe <[email protected]> * Fix never-nil issue with error maps Signed-off-by: Max Smythe <[email protected]> * Address review comments Signed-off-by: Max Smythe <[email protected]> * Add warning when attempting to cache referential data when no driver supports it Signed-off-by: Max Smythe <[email protected]> * re-run manifest generation post-rebase Signed-off-by: Max Smythe <[email protected]> --------- Signed-off-by: Max Smythe <[email protected]>
1 parent 89ae905 commit d82cbe1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+4497
-1035
lines changed

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
# Open Policy Agent Frameworks
22

33
Open Policy Agent is a general-purpose policy system designed to policy-enable other projects and services. The OPA Frameworks repository defines opinionated APIs for policy that are less flexible than the OPA API but are well-suited to particular classes of use cases. For example, Role Based Acces Control (RBAC), Attribute Based Access Control, Access Control Lists (ACLs), and IAM can all be implemented on top of the OPA API and its policy language, and could each be defined as an OPA Framework. One analogy from the web development world that seems to help people is that Frameworks are to OPA as Rails is to Ruby.
4-
5-
## Prerequisites
6-
7-
To clone this repository, you need [git-lfs](https://git-lfs.github.com/) installed.

constraint/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ generate: generate-defaults
7373
# TODO: Once https://github.com/kubernetes/kubernetes/issues/101567 is fixed, update
7474
# conversion-gen and get us back to running `make generate` in our CI pipeline
7575
conversion-gen \
76-
--input-dirs "./pkg/apis/templates/...,./pkg/apis/externaldata/..." \
76+
--input-dirs "./pkg/apis/templates/v1,./pkg/apis/templates/v1beta1,./pkg/apis/templates/v1alpha1,./pkg/apis/externaldata/v1alpha1,./pkg/apis/externaldata/v1beta1" \
77+
--output-base=./ \
7778
--go-header-file=./hack/boilerplate.go.txt \
7879
--output-file-base=zz_generated.conversion \
7980
--extra-dirs=k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1
@@ -125,4 +126,4 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
125126
.PHONY: envtest
126127
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
127128
$(ENVTEST): $(LOCALBIN)
128-
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/[email protected]
129+
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) GCO_ENABLED=0 go install sigs.k8s.io/controller-runtime/tools/[email protected]

constraint/config/crds/externaldata.gatekeeper.sh_providers.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.10.0
6+
controller-gen.kubebuilder.io/version: v0.11.3
77
creationTimestamp: null
88
name: providers.externaldata.gatekeeper.sh
99
spec:

constraint/config/crds/templates.gatekeeper.sh_constrainttemplates.yaml

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.10.0
6+
controller-gen.kubebuilder.io/version: v0.11.3
77
creationTimestamp: null
88
name: constrainttemplates.templates.gatekeeper.sh
99
spec:
@@ -65,6 +65,27 @@ spec:
6565
targets:
6666
items:
6767
properties:
68+
code:
69+
description: The source code options for the constraint template.
70+
"Rego" can only be specified in one place (either here or
71+
in the "rego" field)
72+
items:
73+
properties:
74+
engine:
75+
description: 'The engine used to evaluate the code. Example:
76+
"Rego". Required.'
77+
type: string
78+
source:
79+
description: The source code for the template. Required.
80+
x-kubernetes-preserve-unknown-fields: true
81+
required:
82+
- engine
83+
- source
84+
type: object
85+
type: array
86+
x-kubernetes-list-map-keys:
87+
- engine
88+
x-kubernetes-list-type: map
6889
libs:
6990
items:
7091
type: string
@@ -168,6 +189,27 @@ spec:
168189
targets:
169190
items:
170191
properties:
192+
code:
193+
description: The source code options for the constraint template.
194+
"Rego" can only be specified in one place (either here or
195+
in the "rego" field)
196+
items:
197+
properties:
198+
engine:
199+
description: 'The engine used to evaluate the code. Example:
200+
"Rego". Required.'
201+
type: string
202+
source:
203+
description: The source code for the template. Required.
204+
x-kubernetes-preserve-unknown-fields: true
205+
required:
206+
- engine
207+
- source
208+
type: object
209+
type: array
210+
x-kubernetes-list-map-keys:
211+
- engine
212+
x-kubernetes-list-type: map
171213
libs:
172214
items:
173215
type: string
@@ -271,6 +313,27 @@ spec:
271313
targets:
272314
items:
273315
properties:
316+
code:
317+
description: The source code options for the constraint template.
318+
"Rego" can only be specified in one place (either here or
319+
in the "rego" field)
320+
items:
321+
properties:
322+
engine:
323+
description: 'The engine used to evaluate the code. Example:
324+
"Rego". Required.'
325+
type: string
326+
source:
327+
description: The source code for the template. Required.
328+
x-kubernetes-preserve-unknown-fields: true
329+
required:
330+
- engine
331+
- source
332+
type: object
333+
type: array
334+
x-kubernetes-list-map-keys:
335+
- engine
336+
x-kubernetes-list-type: map
274337
libs:
275338
items:
276339
type: string

0 commit comments

Comments
 (0)