-
Notifications
You must be signed in to change notification settings - Fork 3
/
makefile
32 lines (21 loc) · 1.21 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
.PHONY : test trace
test:
docker run --rm --name opa-test -v $(PWD)/rego:/rego openpolicyagent/opa test /rego -v
trace:
docker run --rm --name opa-test -v $(PWD)/rego:/rego openpolicyagent/opa test /rego -v | grep -i note
.PHONY : install install-core install-validation install-mutation
install-core:
kubectl -n opa create configmap opa-core --from-file=rego/core.rego --dry-run -o yaml | kubectl apply -f -
@kubectl -n opa get cm opa-core -o json | jq '.metadata.annotations["openpolicyagent.org/policy-status"]'
install-validation:
kubectl -n opa create configmap opa-validation --from-file=rego/validation.rego --dry-run -o yaml | kubectl apply -f -
@kubectl -n opa get cm opa-validation -o json | jq '.metadata.annotations["openpolicyagent.org/policy-status"]'
install-mutation:
kubectl -n opa create configmap opa-mutation --from-file=rego/mutation.rego --dry-run -o yaml | kubectl apply -f -
@kubectl -n opa get cm opa-mutation -o json | jq '.metadata.annotations["openpolicyagent.org/policy-status"]'
install-rego: install-core install-validation install-mutation
.PHONY: remove-rego
remove-rego:
kubectl -n opa delete cm opa-mutation
kubectl -n opa delete cm opa-validation
kubectl -n opa delete cm opa-core