-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: migrate from kuttl to chainsaw
Signed-off-by: Charles-Edouard Brétéché <[email protected]>
- Loading branch information
1 parent
cb6bf37
commit 08617b8
Showing
9 changed files
with
165 additions
and
20 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/configuration-chainsaw-v1alpha1.json | ||
apiVersion: chainsaw.kyverno.io/v1alpha1 | ||
kind: Configuration | ||
metadata: | ||
name: configuration | ||
spec: | ||
timeouts: | ||
assert: 5m0s | ||
cleanup: 5m0s | ||
delete: 5m0s | ||
error: 5m0s | ||
exec: 5m0s |
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 |
---|---|---|
|
@@ -157,6 +157,65 @@ jobs: | |
name: logs | ||
path: .logs/* | ||
|
||
chainsaw-test: | ||
needs: [go-build-test, docker-build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@v2 | ||
with: | ||
disable-sudo: true | ||
egress-policy: block | ||
allowed-endpoints: > | ||
api.linode.com:443 | ||
api.github.com:443 | ||
github.com:443 | ||
gcr.io:443 | ||
proxy.golang.org:443 | ||
sum.golang.org:443 | ||
*.githubusercontent.com:443 | ||
docker.io:443 | ||
registry-1.docker.io:443 | ||
auth.docker.io:443 | ||
production.cloudflare.docker.com:443 | ||
storage.googleapis.com:443 | ||
registry.k8s.io:443 | ||
*.pkg.dev:443 | ||
*.amazonaws.com:443 | ||
*.blob.core.windows.net:443 | ||
quay.io:443 | ||
*.quay.io:443 | ||
api.snapcraft.io:443 | ||
cloud.tilt.dev:443 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.22' | ||
|
||
- name: Docker cache | ||
uses: ScribeMD/[email protected] | ||
with: | ||
key: docker-${{ runner.os }}-${{ hashFiles('go.sum') }}} | ||
|
||
- name: Chainsaw test | ||
run: make chainsaw-test | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.github_token }} | ||
LINODE_TOKEN: ${{ secrets.LINODE_TOKEN }} | ||
|
||
- name: Copy logs | ||
if: ${{ always() }} | ||
run: docker cp tilt-control-plane:/var/log .logs | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: ${{ always() }} | ||
with: | ||
name: logs | ||
path: .logs/* | ||
|
||
docker-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
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
5 changes: 0 additions & 5 deletions
5
e2e/linodecluster-controller/minimal-linodecluster/03-verify-nodebalancer.yaml
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
e2e/linodecluster-controller/minimal-linodecluster/04-delete-linodecluster.yaml
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
e2e/linodecluster-controller/minimal-linodecluster/05-verify-nodebalancer-destroyed.yaml
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
81 changes: 81 additions & 0 deletions
81
e2e/linodecluster-controller/minimal-linodecluster/chainsaw-test.yaml
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,81 @@ | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json | ||
apiVersion: chainsaw.kyverno.io/v1alpha1 | ||
kind: Test | ||
metadata: | ||
creationTimestamp: null | ||
name: minimal-linodecluster | ||
spec: | ||
steps: | ||
- name: step-00 | ||
try: | ||
- assert: | ||
file: 00-assert.yaml | ||
- name: step-01 | ||
try: | ||
- apply: | ||
file: 01-create-cluster.yaml | ||
- name: step-02 | ||
try: | ||
- apply: | ||
file: 02-create-linodecluster.yaml | ||
- assert: | ||
file: 02-assert.yaml | ||
- name: step-03 | ||
try: | ||
- script: | ||
env: | ||
- name: TARGET_API | ||
value: api.linode.com | ||
- name: TARGET_API_VERSION | ||
value: v4beta | ||
- name: URI | ||
value: nodebalancers | ||
- name: FILTER | ||
value: '{"label":"linodecluster-test-api-server"}' | ||
content: | | ||
set -e | ||
curl -s \ | ||
-H "Authorization: Bearer $LINODE_TOKEN" \ | ||
-H "X-Filter: $FILTER" \ | ||
-H "Content-Type: application/json" \ | ||
"https://$TARGET_API/$TARGET_API_VERSION/$URI" | ||
check: | ||
($error): ~ | ||
(json_parse($stdout)): | ||
results: 1 | ||
- name: step-04 | ||
try: | ||
- delete: | ||
ref: | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: Cluster | ||
name: cluster-test | ||
- error: | ||
file: 04-error.yaml | ||
- name: step-05 | ||
try: | ||
- script: | ||
env: | ||
- name: TARGET_API | ||
value: api.linode.com | ||
- name: TARGET_API_VERSION | ||
value: v4beta | ||
- name: URI | ||
value: nodebalancers | ||
- name: FILTER | ||
value: '{"label":"linodecluster-test-api-server"}' | ||
content: | | ||
set -e | ||
curl -s \ | ||
-H "Authorization: Bearer $LINODE_TOKEN" \ | ||
-H "X-Filter: $FILTER" \ | ||
-H "Content-Type: application/json" \ | ||
"https://$TARGET_API/$TARGET_API_VERSION/$URI" | ||
check: | ||
($error): ~ | ||
(json_parse($stdout)): | ||
results: 0 | ||
- name: step-06 | ||
try: | ||
- apply: | ||
file: 06-cleanup-cluster.yaml |