Skip to content
Permalink
Browse files

Make constraint targets KRM conventions-compliant (#83)

* Make constraint targets KRM conventions-compliant

Signed-off-by: Max Smythe <smythe@google.com>

* Include the vendor directory

A look at the licenses of the projects shows the following:

  * Apache License
  * ISC License
  * Mozilla Public License
  * MIT
  * BSD

Signed-off-by: Max Smythe <smythe@google.com>

* Fix kubectl apply error in deploy Makefile rule

Signed-off-by: Max Smythe <smythe@google.com>
  • Loading branch information...
maxsmythe committed Apr 7, 2019
1 parent 667f987 commit 434244bbe77de0f49f55641f6fe3ebe64f740bb3
Showing 2,826 changed files with 1,121,097 additions and 12 deletions.
@@ -59,7 +59,6 @@ bld/
#!owners*.txt
/.corext
/.gen*
/vendor
/deploy/secret
/secret
junit.xml
@@ -341,4 +340,4 @@ __pycache__/
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
*.xsd.cs

Some generated files are not rendered by default. Learn more.

@@ -82,6 +82,12 @@ required = [
go-tests = true
unused-packages = true

# We want to include all files so we can access the constraint CRD manifests
[[prune.project]]
name = "github.com/open-policy-agent/frameworks"
unused-packages = false
go-tests = false



# For dependency below: Refer to issue https://github.com/golang/dep/issues/1799
@@ -51,6 +51,7 @@ install: manifests
# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
deploy: manifests
kubectl apply -f config/crds
kubectl apply -f vendor/github.com/open-policy-agent/frameworks/constraint/config/crds
kustomize build config/default | kubectl apply -f -

# Generate manifests e.g. CRD, RBAC etc.
@@ -18,7 +18,7 @@ spec:
type: array
items: string
targets:
admission.k8s.gatekeeper.sh:
- target: admission.k8s.gatekeeper.sh
rego: |
package k8srequiredlabels
@@ -18,7 +18,7 @@ spec:
type: array
items: string
targets:
admission.k8s.gatekeeper.sh:
- target: admission.k8s.gatekeeper.sh
rego: |
package k8srequiredlabels
@@ -35,7 +35,10 @@ var cfg *rest.Config

func TestMain(m *testing.M) {
t := &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crds")},
CRDDirectoryPaths: []string{
filepath.Join("..", "..", "..", "config", "crds"),
filepath.Join("..", "..", "..", "vendor", "github.com", "open-policy-agent", "frameworks", "constraint", "config", "crds"),
},
}
apis.AddToScheme(scheme.Scheme)

@@ -63,8 +63,10 @@ func TestReconcile(t *testing.T) {
},
},
},
Targets: map[string]v1alpha1.Target{
"admission.k8s.gatekeeper.sh": {Rego: `
Targets: []v1alpha1.Target{
{
Target: "admission.k8s.gatekeeper.sh",
Rego: `
package foo
deny[{"msg": "denied!"}] {

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

0 comments on commit 434244b

Please sign in to comment.
You can’t perform that action at this time.