Skip to content

Commit 7d0b7c2

Browse files
committed
chore: migrate from kuttl to chainsaw
Signed-off-by: Charles-Edouard Brétéché <[email protected]>
1 parent 4f4a534 commit 7d0b7c2

22 files changed

+200
-99
lines changed

e2e/.chainsaw.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/configuration-chainsaw-v1alpha1.json
2+
apiVersion: chainsaw.kyverno.io/v1alpha1
3+
kind: Configuration
4+
metadata:
5+
name: configuration
6+
spec:
7+
timeouts:
8+
assert: 5m0s
9+
cleanup: 5m0s
10+
delete: 5m0s
11+
error: 5m0s
12+
exec: 5m0s

e2e/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ _runThisTest:
1212
cp $(ROOT_DIR)/e2e/Makefile $$D ;\
1313
mkdir $$D/suit ;\
1414
cp -r $(PWD) $$D/suit ;\
15-
ROOT_DIR=$(ROOT_DIR) KUBECONFIG="$(ROOT_DIR)/kubeconfig" kubectl-kuttl test --timeout 300 --skip-delete "$$D/suit"
15+
ROOT_DIR=$(ROOT_DIR) KUBECONFIG="$(ROOT_DIR)/kubeconfig" chainsaw test --skip-delete "$$D/suit"
1616

1717
runTestSuit:
18-
@T="$$(KUBECONFIG="$$ROOT_DIR/kubeconfig" kubectl-kuttl test --timeout 300 --skip-delete --namespace "$$NAMESPACE" "$$TS" 2>&1)" ;\
18+
@T="$$(KUBECONFIG="$$ROOT_DIR/kubeconfig" chainsaw test --skip-delete --namespace "$$NAMESPACE" "$$TS" 2>&1)" ;\
1919
echo "$$T" |\
2020
grep -v harness.go |\
2121
grep -v ^=== |\

e2e/README.MD

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# E2E Framework
22

3-
The E2E framework uses Kuttl under the hood. Kuttl is a simple and most importantly static tool.
3+
The E2E framework uses Chainsaw under the hood. Chainsaw is a simple and most importantly static tool.
44
That means there is no way to dynamically generate manifests.
55
The solution is KIK (Kuttl-In-Kuttl)!
66

e2e/kuttl-config.yaml

-7
This file was deleted.

e2e/linodecluster-controller/minimal/02-create-linodecluster.tpl.yml

-11
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
apiVersion: kuttl.dev/v1beta1
2-
kind: TestStep
3-
commands:
4-
- script: |-
5-
CLUSTER_UID="$(OBJ=clusters/cluster-sample make getKubeUid)" \
6-
TS="$(TPL="$PWD/02-create-linodecluster.tpl.yml" make renderTestCase)" make runTestSuit
1+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
2+
kind: LinodeCluster
3+
metadata:
4+
name: linodecluster-sample
5+
ownerReferences:
6+
- apiVersion: cluster.x-k8s.io/v1beta1
7+
kind: Cluster
8+
name: cluster-sample
9+
uid: (x_k8s_get($client, 'cluster.x-k8s.io/v1beta1', 'Cluster', $namespace, 'cluster-sample').metadata.uid)
10+
spec:
11+
region: us-sea

e2e/linodecluster-controller/minimal/03-verify-nodebalancer.yaml

-5
This file was deleted.

e2e/linodecluster-controller/minimal/04-delete-linodecluster.yaml

-6
This file was deleted.

e2e/linodecluster-controller/minimal/05-verify-nodebalancer-destroyed.yaml

-5
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json
2+
apiVersion: chainsaw.kyverno.io/v1alpha1
3+
kind: Test
4+
metadata:
5+
creationTimestamp: null
6+
name: minimal
7+
spec:
8+
steps:
9+
- name: step-00
10+
try:
11+
- assert:
12+
file: 00-assert.yaml
13+
- name: step-01
14+
try:
15+
- apply:
16+
file: 01-create-cluster.yaml
17+
- name: step-02
18+
try:
19+
- apply:
20+
file: 02-create-linodecluster.yaml
21+
- assert:
22+
file: 02-assert.yaml
23+
- name: step-03
24+
try:
25+
- script:
26+
content: 'URI="nodebalancers" FILTER="{\"tags\":\"$(OBJ=linodeclusters/linodecluster-sample
27+
make getKubeUid)\"}" make callLinodeApiGet | grep ''results": 1'''
28+
- name: step-04
29+
try:
30+
- delete:
31+
ref:
32+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
33+
kind: LinodeCluster
34+
name: linodecluster-sample
35+
- apply:
36+
file: 04-error.yaml
37+
- name: step-05
38+
try:
39+
- script:
40+
content: 'URI="nodebalancers" FILTER="{\"tags\":\"$(OBJ=linodeclusters/linodecluster-sample
41+
make getKubeUid)\"}" make callLinodeApiGet | grep ''results": 0'''

e2e/linodemachine-controller/byovpc/01-create-cluster.yaml

-11
This file was deleted.

e2e/linodemachine-controller/byovpc/02-create-linodemachine.yaml

-6
This file was deleted.

e2e/linodemachine-controller/byovpc/03-delete-linodemachine.yaml

-6
This file was deleted.

e2e/linodemachine-controller/byovpc/04-verify-linode-instance.yaml

-5
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json
2+
apiVersion: chainsaw.kyverno.io/v1alpha1
3+
kind: Test
4+
metadata:
5+
creationTimestamp: null
6+
name: byovpc
7+
spec:
8+
steps:
9+
- name: step-00
10+
try:
11+
- assert:
12+
file: 00-assert.yaml
13+
- name: step-01
14+
try:
15+
- command:
16+
args:
17+
- createVPC
18+
entrypoint: make
19+
- script:
20+
content: |-
21+
VPC_ID=$(make fetchVPCID) \
22+
TS="$(TPL="$PWD/01-create-vpc.tpl.yml" make renderTestCase)" make runTestSuit
23+
- command:
24+
args:
25+
- enableVPC
26+
entrypoint: make
27+
- script:
28+
content: |-
29+
VPC_UID="$(OBJ=linodevpcs/linodevpc-sample make getKubeUid)" \
30+
TS="$(TPL="$PWD/01-create-cluster.tpl.yml" make renderTestCase)" make runTestSuit
31+
- apply:
32+
file: 01-create-cluster.tpl.yml
33+
- apply:
34+
file: 01-create-vpc.tpl.yml
35+
- assert:
36+
file: 01-assert.yaml
37+
- name: step-02
38+
try:
39+
- script:
40+
content: |-
41+
MACHINE_UID="$(OBJ=machines/machine-sample make getKubeUid)" \
42+
TS="$(TPL="$PWD/02-create-linodemachine.tpl.yml" make renderTestCase)" make runTestSuit
43+
- apply:
44+
file: 02-create-linodemachine.tpl.yml
45+
- assert:
46+
file: 02-assert.yaml
47+
- name: step-03
48+
try:
49+
- delete:
50+
ref:
51+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
52+
kind: LinodeMachine
53+
name: linodemachine-sample
54+
- apply:
55+
file: 03-error.yaml
56+
- name: step-04
57+
try:
58+
- script:
59+
content: 'URI="linode/instances" FILTER="{\"tags\":\"$(OBJ=linodemachines/linodemachine-sample
60+
make getKubeUid)\"}" make callLinodeApiGet | grep ''results": 0'''

e2e/linodemachine-controller/minimal/02-create-linodemachine.yaml

-6
This file was deleted.

e2e/linodemachine-controller/minimal/03-delete-linodemachine.yaml

-6
This file was deleted.

e2e/linodemachine-controller/minimal/04-verify-linode-instance.yaml

-5
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json
2+
apiVersion: chainsaw.kyverno.io/v1alpha1
3+
kind: Test
4+
metadata:
5+
creationTimestamp: null
6+
name: minimal
7+
spec:
8+
steps:
9+
- name: step-00
10+
try:
11+
- assert:
12+
file: 00-assert.yaml
13+
- name: step-01
14+
try:
15+
- apply:
16+
file: 01-create-cluster.yaml
17+
- name: step-02
18+
try:
19+
- script:
20+
content: |-
21+
MACHINE_UID="$(OBJ=machines/machine-sample make getKubeUid)" \
22+
TS="$(TPL="$PWD/02-create-linodemachine.tpl.yml" make renderTestCase)" make runTestSuit
23+
- apply:
24+
file: 02-create-linodemachine.tpl.yml
25+
- assert:
26+
file: 02-assert.yaml
27+
- name: step-03
28+
try:
29+
- delete:
30+
ref:
31+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
32+
kind: LinodeMachine
33+
name: linodemachine-sample
34+
- apply:
35+
file: 03-error.yaml
36+
- name: step-04
37+
try:
38+
- script:
39+
content: 'URI="linode/instances" FILTER="{\"tags\":\"$(OBJ=linodemachines/linodemachine-sample
40+
make getKubeUid)\"}" make callLinodeApiGet | grep ''results": 0'''

e2e/linodevpc-controller/minimal/02-delete-vpc.yaml

-6
This file was deleted.

e2e/linodevpc-controller/minimal/03-verify-vpc.yaml

-5
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json
2+
apiVersion: chainsaw.kyverno.io/v1alpha1
3+
kind: Test
4+
metadata:
5+
creationTimestamp: null
6+
name: minimal
7+
spec:
8+
steps:
9+
- name: step-00
10+
try:
11+
- assert:
12+
file: 00-assert.yaml
13+
- name: step-01
14+
try:
15+
- apply:
16+
file: 01-create-vpc.yaml
17+
- assert:
18+
file: 01-assert.yaml
19+
- name: step-02
20+
try:
21+
- delete:
22+
ref:
23+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
24+
kind: LinodeVPC
25+
name: linodevpc-sample
26+
- apply:
27+
file: 02-error.yaml
28+
- name: step-03
29+
try:
30+
- script:
31+
content: 'URI="vpcs" FILTER="{\"label\":\"CLi-$(OBJ=linodevpcs/linodevpc-sample
32+
make getKubeUid | sed ''s/-//g'')\"}" make callLinodeApiGet | grep ''results":
33+
0'''

0 commit comments

Comments
 (0)