-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b5d52ac
commit 9dc89e7
Showing
3 changed files
with
13 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,8 +16,7 @@ jobs: | |
name: Continous integration | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
- uses: actions/checkout@v2 | ||
- uses: azure/setup-helm@v1 | ||
with: | ||
version: "3.3.4" | ||
|
@@ -27,10 +26,10 @@ jobs: | |
helm lint . --strict | ||
helm lint . --strict -f test/linter/values-lint.yaml | ||
helm dep up test/linter/subchart && helm lint test/linter/subchart --strict | ||
# - name: conftest | ||
# run: | | ||
# conftest --version | ||
# helm template . | conftest test --policy test/conftest/policy/ test --output table - | ||
- name: conftest | ||
run: | | ||
helm template . > /tmp/cmak.yaml | ||
conftest test /tmp/cmak.yaml -p test/conftest -o table --all-namespaces | ||
- name: start k8s with k3d | ||
uses: AbsaOSS/[email protected] | ||
with: | ||
|
4 changes: 2 additions & 2 deletions
4
test/conftest/policy/deployment.rego → test/conftest/deployment.rego
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
package main | ||
package main.deployment | ||
|
||
deny[msg] { | ||
input.kind == "Deployment" | ||
not input.spec.selector.matchLabels["app.kubernetes.io/name"] | ||
not input.spec.selector.matchLabels["app.kubernetes.io/instance"] | ||
|
||
msg := "Containers must provide app.kubernetes.io/name and app.kubernetes.io/instance labels for pod selectors" | ||
msg := "Containers must provide predefined labels for pod selectors" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package main.ingress | ||
|
||
deny[msg] { | ||
input.kind == "Ingress" | ||
msg := "Ingress must not be created by default" | ||
} |