Skip to content

Commit 7c62eb2

Browse files
authored
🌱 test: use cluster without worker definition for kcp only test (#11212)
* test: use cluster without worker definition for kcp only test * add additional quick-start test for covering zero replicas * Rewrite quick-start test * comment fix * fix kcp-only clusterclass
1 parent d495b4e commit 7c62eb2

File tree

14 files changed

+83
-5
lines changed

14 files changed

+83
-5
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ hack/tools/bin
1212

1313
# E2E test templates
1414
test/e2e/data/infrastructure-docker/**/cluster-template*.yaml
15+
!test/e2e/data/infrastructure-docker/**/clusterclass-quick-start.yaml
16+
!test/e2e/data/infrastructure-docker/**/clusterclass-quick-start-runtimesdk.yaml
17+
test/e2e/data/infrastructure-docker/**/clusterclass-*.yaml
1518
test/e2e/data/infrastructure-inmemory/**/cluster-template*.yaml
1619

1720
# Output of Makefile targets using sed on MacOS systems

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,10 +611,12 @@ generate-e2e-templates-main: $(KUSTOMIZE)
611611
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-ipv6 --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-ipv6.yaml
612612
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-topology-dualstack-ipv6-primary --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-topology-dualstack-ipv6-primary.yaml
613613
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-topology-dualstack-ipv4-primary --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-topology-dualstack-ipv4-primary.yaml
614-
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-topology-single-node-cluster --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-topology-single-node-cluster.yaml
614+
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-topology-no-workers --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-topology-no-workers.yaml
615+
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-topology-kcp-only --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-topology-kcp-only.yaml
615616
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-topology-autoscaler --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-topology-autoscaler.yaml
616617
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-topology --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-topology.yaml
617618
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-ignition --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-ignition.yaml
619+
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/clusterclass-quick-start-kcp-only --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/clusterclass-quick-start-kcp-only.yaml
618620

619621
$(KUSTOMIZE) build $(INMEMORY_TEMPLATES)/main/cluster-template --load-restrictor LoadRestrictionsNone > $(INMEMORY_TEMPLATES)/main/cluster-template.yaml
620622

test/e2e/config/docker.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,11 +354,13 @@ providers:
354354
- sourcePath: "../data/infrastructure-docker/main/cluster-template-ipv6.yaml"
355355
- sourcePath: "../data/infrastructure-docker/main/cluster-template-topology-dualstack-ipv6-primary.yaml"
356356
- sourcePath: "../data/infrastructure-docker/main/cluster-template-topology-dualstack-ipv4-primary.yaml"
357-
- sourcePath: "../data/infrastructure-docker/main/cluster-template-topology-single-node-cluster.yaml"
357+
- sourcePath: "../data/infrastructure-docker/main/cluster-template-topology-no-workers.yaml"
358+
- sourcePath: "../data/infrastructure-docker/main/cluster-template-topology-kcp-only.yaml"
358359
- sourcePath: "../data/infrastructure-docker/main/cluster-template-topology-autoscaler.yaml"
359360
- sourcePath: "../data/infrastructure-docker/main/cluster-template-topology.yaml"
360361
- sourcePath: "../data/infrastructure-docker/main/cluster-template-ignition.yaml"
361362
- sourcePath: "../data/infrastructure-docker/main/clusterclass-quick-start.yaml"
363+
- sourcePath: "../data/infrastructure-docker/main/clusterclass-quick-start-kcp-only.yaml"
362364
- sourcePath: "../data/infrastructure-docker/main/clusterclass-quick-start-runtimesdk.yaml"
363365
- sourcePath: "../data/shared/main/metadata.yaml"
364366

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- op: add
2+
path: /spec/topology/class
3+
value: "quick-start-kcp-only"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
resources:
2+
- ../cluster-template-topology-no-workers
3+
4+
patches:
5+
- path: cluster-topology-class.yaml
6+
target:
7+
group: cluster.x-k8s.io
8+
version: v1beta1
9+
kind: Cluster
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ patches:
88
group: cluster.x-k8s.io
99
version: v1beta1
1010
kind: Cluster
11-
11+
- path: remove-topology-workers.yaml
12+
target:
13+
group: cluster.x-k8s.io
14+
version: v1beta1
15+
kind: Cluster
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- op: remove
2+
path: /spec/topology/workers
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- op: replace
2+
path: /metadata/name
3+
value: quick-start-kcp-only
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
resources:
2+
- ../clusterclass-quick-start.yaml
3+
4+
patches:
5+
- path: remove-workers.yaml
6+
target:
7+
group: cluster.x-k8s.io
8+
version: v1beta1
9+
kind: ClusterClass
10+
- path: clusterclass-name.yaml
11+
target:
12+
group: cluster.x-k8s.io
13+
version: v1beta1
14+
kind: ClusterClass
15+
- path: remove-worker-patches.yaml
16+
target:
17+
group: cluster.x-k8s.io
18+
version: v1beta1
19+
kind: ClusterClass

0 commit comments

Comments
 (0)