Skip to content

Commit f20d5f3

Browse files
committed
start fix remove rolegroup tests
1 parent ec9fd3c commit f20d5f3

12 files changed

Lines changed: 89 additions & 21 deletions

File tree

rust/operator-binary/src/crd/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ impl v1alpha1::KafkaCluster {
258258
///
259259
/// We try to predict the pods here rather than looking at the current cluster state in order to
260260
/// avoid instance churn.
261+
// TODO: this currently only checks within each role, node.id must be unique for all brokers and controllers
261262
pub fn pod_descriptors(
262263
&self,
263264
kafka_role: &KafkaRole,

tests/templates/kuttl/delete-rolegroup/01-assert.yaml renamed to tests/templates/kuttl/delete-rolegroup/01-assert.yaml.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{% if test_scenario['values']['use-kraft-controller'] == 'false' %}
12
---
23
apiVersion: kuttl.dev/v1beta1
34
kind: TestAssert
@@ -10,3 +11,4 @@ metadata:
1011
status:
1112
readyReplicas: 1
1213
replicas: 1
14+
{% endif %}

tests/templates/kuttl/delete-rolegroup/01-install-zk.yaml.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{% if test_scenario['values']['use-kraft-controller'] == 'false' %}
12
---
23
apiVersion: zookeeper.stackable.tech/v1alpha1
34
kind: ZookeeperCluster
@@ -18,3 +19,4 @@ spec:
1819
roleGroups:
1920
default:
2021
replicas: 1
22+
{% endif %}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestAssert
4+
timeout: 300
5+
---
6+
apiVersion: apps/v1
7+
kind: StatefulSet
8+
metadata:
9+
name: test-kafka-broker-default
10+
status:
11+
readyReplicas: 1
12+
replicas: 1
13+
---
14+
apiVersion: apps/v1
15+
kind: StatefulSet
16+
metadata:
17+
name: test-kafka-broker-secondary
18+
status:
19+
readyReplicas: 1
20+
replicas: 1
21+
{% if test_scenario['values']['use-kraft-controller'] == 'true' %}
22+
---
23+
apiVersion: apps/v1
24+
kind: StatefulSet
25+
metadata:
26+
name: test-kafka-controller-default
27+
status:
28+
readyReplicas: 2
29+
replicas: 2
30+
---
31+
apiVersion: apps/v1
32+
kind: StatefulSet
33+
metadata:
34+
name: test-kafka-controller-secondary
35+
status:
36+
readyReplicas: 1
37+
replicas: 1
38+
{% endif %}

tests/templates/kuttl/delete-rolegroup/02-install-kafka.yaml.j2

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,23 @@ spec:
2020
{% if lookup('env', 'VECTOR_AGGREGATOR') %}
2121
vectorAggregatorConfigMapName: vector-aggregator-discovery
2222
{% endif %}
23+
{% if test_scenario['values']['use-kraft-controller'] == 'false' %}
2324
zookeeperConfigMapName: test-zk
25+
{% else %}
26+
controllers:
27+
config:
28+
gracefulShutdownTimeout: 30s # speed up tests
29+
logging:
30+
enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }}
31+
roleGroups:
32+
default:
33+
replicas: 2
34+
secondary:
35+
replicas: 1
36+
{% endif %}
2437
brokers:
2538
config:
39+
gracefulShutdownTimeout: 30s # speed up tests
2640
logging:
2741
enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }}
2842
roleGroups:

tests/templates/kuttl/delete-rolegroup/03-assert.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

tests/templates/kuttl/delete-rolegroup/02-assert.yaml renamed to tests/templates/kuttl/delete-rolegroup/03-assert.yaml.j2

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ metadata:
1010
status:
1111
readyReplicas: 1
1212
replicas: 1
13+
{% if test_scenario['values']['use-kraft-controller'] == 'true' %}
1314
---
1415
apiVersion: apps/v1
1516
kind: StatefulSet
1617
metadata:
17-
name: test-kafka-broker-secondary
18+
name: test-kafka-controller-default
1819
status:
19-
readyReplicas: 1
20-
replicas: 1
20+
readyReplicas: 2
21+
replicas: 2
22+
{% endif %}

tests/templates/kuttl/delete-rolegroup/03-delete-secondary.yaml.j2

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,22 @@ spec:
1919
{% if lookup('env', 'VECTOR_AGGREGATOR') %}
2020
vectorAggregatorConfigMapName: vector-aggregator-discovery
2121
{% endif %}
22+
{% if test_scenario['values']['use-kraft-controller'] == 'false' %}
2223
zookeeperConfigMapName: test-zk
24+
{% else %}
25+
controllers:
26+
config:
27+
gracefulShutdownTimeout: 30s # speed up tests
28+
logging:
29+
enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }}
30+
roleGroups:
31+
default:
32+
replicas: 2
33+
secondary: null
34+
{% endif %}
2335
brokers:
2436
config:
37+
gracefulShutdownTimeout: 30s # speed up tests
2538
logging:
2639
enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }}
2740
roleGroups:

tests/templates/kuttl/delete-rolegroup/03-errors.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
apiVersion: apps/v1
3+
kind: StatefulSet
4+
metadata:
5+
name: test-kafka-broker-secondary
6+
{% if test_scenario['values']['use-kraft-controller'] == 'true' %}
7+
---
8+
apiVersion: apps/v1
9+
kind: StatefulSet
10+
metadata:
11+
name: test-kafka-controller-secondary
12+
{% endif %}

0 commit comments

Comments
 (0)