Skip to content

Commit dbdf6f8

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

24 files changed

+207
-204
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

-89
This file was deleted.

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.

e2e/linodecluster-controller/minimal/06-cleanup-cluster.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+
- error:
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+
- error:
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.tpl.yml

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

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,36 @@
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-linodemachine.tpl.yml
21+
- assert:
22+
file: 02-assert.yaml
23+
- name: step-03
24+
try:
25+
- delete:
26+
ref:
27+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
28+
kind: LinodeMachine
29+
name: linodemachine-sample
30+
- error:
31+
file: 03-error.yaml
32+
- name: step-04
33+
try:
34+
- script:
35+
content: 'URI="linode/instances" FILTER="{\"tags\":\"$(OBJ=linodemachines/linodemachine-sample
36+
make getKubeUid)\"}" make callLinodeApiGet | grep ''results": 0'''

0 commit comments

Comments
 (0)