From a8fee5540401a96fa98fb9ccd648aa8677ca061c Mon Sep 17 00:00:00 2001 From: Jakub Scholz Date: Tue, 12 Dec 2023 18:58:38 +0100 Subject: [PATCH] Add current roles to the node pool status Signed-off-by: Jakub Scholz --- .../model/nodepool/KafkaNodePoolStatus.java | 12 +++++++++- .../operator/cluster/model/KafkaPool.java | 1 + .../nodepools/VirtualNodePoolConverter.java | 1 + .../model/KafkaClusterWithKRaftTest.java | 4 ++++ .../model/KafkaClusterWithPoolsTest.java | 4 ++++ .../operator/cluster/model/KafkaPoolTest.java | 2 ++ .../VirtualNodePoolConverterTest.java | 6 +++++ ...afkaAssemblyOperatorWithPoolsMockTest.java | 20 ++++++++++++++++ .../KafkaAssemblyOperatorWithPoolsTest.java | 23 +++++++++++++++++++ documentation/modules/appendix_crds.adoc | 2 ++ .../crds/04A-Crd-kafkanodepool.yaml | 8 +++++++ .../04A-Crd-kafkanodepool.yaml | 8 +++++++ 12 files changed, 90 insertions(+), 1 deletion(-) diff --git a/api/src/main/java/io/strimzi/api/kafka/model/nodepool/KafkaNodePoolStatus.java b/api/src/main/java/io/strimzi/api/kafka/model/nodepool/KafkaNodePoolStatus.java index 51a2827d978..28174e6887f 100644 --- a/api/src/main/java/io/strimzi/api/kafka/model/nodepool/KafkaNodePoolStatus.java +++ b/api/src/main/java/io/strimzi/api/kafka/model/nodepool/KafkaNodePoolStatus.java @@ -23,7 +23,7 @@ builderPackage = Constants.FABRIC8_KUBERNETES_API ) @JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ "conditions", "observedGeneration", "nodeIds", "clusterId", "replicas", "labelSelector" }) +@JsonPropertyOrder({ "conditions", "observedGeneration", "nodeIds", "clusterId", "roles", "replicas", "labelSelector" }) @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class KafkaNodePoolStatus extends Status { @@ -31,6 +31,7 @@ public class KafkaNodePoolStatus extends Status { private List nodeIds; private String clusterId; + private List roles; // Replicas and label selector are required for scale subresource private int replicas; @@ -54,6 +55,15 @@ public void setClusterId(String clusterId) { this.clusterId = clusterId; } + @Description("The roles currently assigned to this pool.") + public List getRoles() { + return roles; + } + + public void setRoles(List roles) { + this.roles = roles; + } + @JsonInclude(JsonInclude.Include.NON_NULL) @Description("The current number of pods being used to provide this resource.") public int getReplicas() { diff --git a/cluster-operator/src/main/java/io/strimzi/operator/cluster/model/KafkaPool.java b/cluster-operator/src/main/java/io/strimzi/operator/cluster/model/KafkaPool.java index ae12e425b1f..891d4698f95 100644 --- a/cluster-operator/src/main/java/io/strimzi/operator/cluster/model/KafkaPool.java +++ b/cluster-operator/src/main/java/io/strimzi/operator/cluster/model/KafkaPool.java @@ -302,6 +302,7 @@ public KafkaNodePoolStatus generateNodePoolStatus(String clusterId) { return new KafkaNodePoolStatusBuilder() .withClusterId(clusterId) .withNodeIds(new ArrayList<>(idAssignment.desired())) + .withRoles(processRoles.stream().sorted().toList()) .withReplicas(idAssignment.desired().size()) .withLabelSelector(getSelectorLabels().toSelectorString()) .withConditions(warningConditions) diff --git a/cluster-operator/src/main/java/io/strimzi/operator/cluster/model/nodepools/VirtualNodePoolConverter.java b/cluster-operator/src/main/java/io/strimzi/operator/cluster/model/nodepools/VirtualNodePoolConverter.java index ec012f8e81e..f986ad04fe1 100644 --- a/cluster-operator/src/main/java/io/strimzi/operator/cluster/model/nodepools/VirtualNodePoolConverter.java +++ b/cluster-operator/src/main/java/io/strimzi/operator/cluster/model/nodepools/VirtualNodePoolConverter.java @@ -57,6 +57,7 @@ public static KafkaNodePool convertKafkaToVirtualNodePool(Kafka kafka, Integer e .endSpec() .withNewStatus() .withNodeIds(nodeIds) + .withRoles(ProcessRoles.BROKER) .endStatus() .build(); } diff --git a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaClusterWithKRaftTest.java b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaClusterWithKRaftTest.java index 3471752be28..df1c1435820 100644 --- a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaClusterWithKRaftTest.java +++ b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaClusterWithKRaftTest.java @@ -176,10 +176,14 @@ public void testNodesAndStatuses() { assertThat(statuses.get("controllers").getLabelSelector(), is("strimzi.io/cluster=my-cluster,strimzi.io/name=my-cluster-kafka,strimzi.io/kind=Kafka,strimzi.io/pool-name=controllers")); assertThat(statuses.get("controllers").getNodeIds().size(), is(3)); assertThat(statuses.get("controllers").getNodeIds(), hasItems(0, 1, 2)); + assertThat(statuses.get("controllers").getRoles().size(), is(1)); + assertThat(statuses.get("controllers").getRoles(), hasItems(ProcessRoles.CONTROLLER)); assertThat(statuses.get("brokers").getReplicas(), is(3)); assertThat(statuses.get("brokers").getLabelSelector(), is("strimzi.io/cluster=my-cluster,strimzi.io/name=my-cluster-kafka,strimzi.io/kind=Kafka,strimzi.io/pool-name=brokers")); assertThat(statuses.get("brokers").getNodeIds().size(), is(3)); assertThat(statuses.get("brokers").getNodeIds(), hasItems(1000, 1001, 1002)); + assertThat(statuses.get("brokers").getRoles().size(), is(1)); + assertThat(statuses.get("brokers").getRoles(), hasItems(ProcessRoles.BROKER)); } @Test diff --git a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaClusterWithPoolsTest.java b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaClusterWithPoolsTest.java index bed249d7771..3c9a65a46de 100644 --- a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaClusterWithPoolsTest.java +++ b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaClusterWithPoolsTest.java @@ -158,10 +158,14 @@ public void testNodesAndStatuses() { assertThat(statuses.get("pool-a").getLabelSelector(), is("strimzi.io/cluster=my-cluster,strimzi.io/name=my-cluster-kafka,strimzi.io/kind=Kafka,strimzi.io/pool-name=pool-a")); assertThat(statuses.get("pool-a").getNodeIds().size(), is(3)); assertThat(statuses.get("pool-a").getNodeIds(), hasItems(0, 1, 2)); + assertThat(statuses.get("pool-a").getRoles().size(), is(1)); + assertThat(statuses.get("pool-a").getRoles(), hasItems(ProcessRoles.BROKER)); assertThat(statuses.get("pool-b").getReplicas(), is(2)); assertThat(statuses.get("pool-b").getLabelSelector(), is("strimzi.io/cluster=my-cluster,strimzi.io/name=my-cluster-kafka,strimzi.io/kind=Kafka,strimzi.io/pool-name=pool-b")); assertThat(statuses.get("pool-b").getNodeIds().size(), is(2)); assertThat(statuses.get("pool-b").getNodeIds(), hasItems(10, 11)); + assertThat(statuses.get("pool-b").getRoles().size(), is(1)); + assertThat(statuses.get("pool-b").getRoles(), hasItems(ProcessRoles.BROKER)); } @Test diff --git a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaPoolTest.java b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaPoolTest.java index 200a1906e94..c93939dba0a 100644 --- a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaPoolTest.java +++ b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaPoolTest.java @@ -123,6 +123,8 @@ public void testKafkaPool() { assertThat(status.getLabelSelector(), is("strimzi.io/cluster=my-cluster,strimzi.io/name=my-cluster-kafka,strimzi.io/kind=Kafka,strimzi.io/pool-name=pool")); assertThat(status.getNodeIds().size(), is(3)); assertThat(status.getNodeIds(), hasItems(10, 11, 13)); + assertThat(status.getRoles().size(), is(1)); + assertThat(status.getRoles(), hasItems(ProcessRoles.BROKER)); } @Test diff --git a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/nodepools/VirtualNodePoolConverterTest.java b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/nodepools/VirtualNodePoolConverterTest.java index 362b377c09a..0899c474cda 100644 --- a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/nodepools/VirtualNodePoolConverterTest.java +++ b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/nodepools/VirtualNodePoolConverterTest.java @@ -182,6 +182,8 @@ public void testConvertMinimalKafka() { // Status assertThat(pool.getStatus().getNodeIds(), is(nullValue())); + assertThat(pool.getStatus().getRoles().size(), is(1)); + assertThat(pool.getStatus().getRoles(), hasItems(ProcessRoles.BROKER)); } @Test @@ -206,6 +208,8 @@ public void testConvertKafkaWithExistingReplicas() { // Status assertThat(pool.getStatus().getNodeIds().size(), is(3)); assertThat(pool.getStatus().getNodeIds(), hasItems(0, 1, 2)); + assertThat(pool.getStatus().getRoles().size(), is(1)); + assertThat(pool.getStatus().getRoles(), hasItems(ProcessRoles.BROKER)); } @Test @@ -267,5 +271,7 @@ public void testConvertMaximalKafka() { // Status assertThat(pool.getStatus().getNodeIds().size(), is(3)); assertThat(pool.getStatus().getNodeIds(), hasItems(0, 1, 2)); + assertThat(pool.getStatus().getRoles().size(), is(1)); + assertThat(pool.getStatus().getRoles(), hasItems(ProcessRoles.BROKER)); } } diff --git a/cluster-operator/src/test/java/io/strimzi/operator/cluster/operator/assembly/KafkaAssemblyOperatorWithPoolsMockTest.java b/cluster-operator/src/test/java/io/strimzi/operator/cluster/operator/assembly/KafkaAssemblyOperatorWithPoolsMockTest.java index 26ecbe09647..3ef0beb9e52 100644 --- a/cluster-operator/src/test/java/io/strimzi/operator/cluster/operator/assembly/KafkaAssemblyOperatorWithPoolsMockTest.java +++ b/cluster-operator/src/test/java/io/strimzi/operator/cluster/operator/assembly/KafkaAssemblyOperatorWithPoolsMockTest.java @@ -501,10 +501,14 @@ public void testReconcileKafkaScaleDown(VertxTestContext context) { KafkaNodePool poolA = Crds.kafkaNodePoolOperation(client).inNamespace(NAMESPACE).withName("pool-a").get(); assertThat(poolA.getStatus().getReplicas(), is(2)); assertThat(poolA.getStatus().getNodeIds(), is(List.of(0, 1))); + assertThat(poolA.getStatus().getRoles().size(), is(1)); + assertThat(poolA.getStatus().getRoles(), hasItems(ProcessRoles.BROKER)); KafkaNodePool poolB = Crds.kafkaNodePoolOperation(client).inNamespace(NAMESPACE).withName("pool-b").get(); assertThat(poolB.getStatus().getReplicas(), is(2)); assertThat(poolB.getStatus().getNodeIds(), is(List.of(3, 4))); + assertThat(poolB.getStatus().getRoles().size(), is(1)); + assertThat(poolB.getStatus().getRoles(), hasItems(ProcessRoles.BROKER)); async.flag(); }))); @@ -543,10 +547,14 @@ public void testReconcileKafkaScaleUp(VertxTestContext context) { KafkaNodePool poolA = Crds.kafkaNodePoolOperation(client).inNamespace(NAMESPACE).withName("pool-a").get(); assertThat(poolA.getStatus().getReplicas(), is(4)); assertThat(poolA.getStatus().getNodeIds(), is(List.of(0, 1, 2, 5))); + assertThat(poolA.getStatus().getRoles().size(), is(1)); + assertThat(poolA.getStatus().getRoles(), hasItems(ProcessRoles.BROKER)); KafkaNodePool poolB = Crds.kafkaNodePoolOperation(client).inNamespace(NAMESPACE).withName("pool-b").get(); assertThat(poolB.getStatus().getReplicas(), is(2)); assertThat(poolB.getStatus().getNodeIds(), is(List.of(3, 4))); + assertThat(poolB.getStatus().getRoles().size(), is(1)); + assertThat(poolB.getStatus().getRoles(), hasItems(ProcessRoles.BROKER)); async.flag(); }))); @@ -601,14 +609,20 @@ public void testReconcileAddPool(VertxTestContext context) { KafkaNodePool poolA = Crds.kafkaNodePoolOperation(client).inNamespace(NAMESPACE).withName("pool-a").get(); assertThat(poolA.getStatus().getReplicas(), is(3)); assertThat(poolA.getStatus().getNodeIds(), is(List.of(0, 1, 2))); + assertThat(poolA.getStatus().getRoles().size(), is(1)); + assertThat(poolA.getStatus().getRoles(), hasItems(ProcessRoles.BROKER)); KafkaNodePool poolB = Crds.kafkaNodePoolOperation(client).inNamespace(NAMESPACE).withName("pool-b").get(); assertThat(poolB.getStatus().getReplicas(), is(2)); assertThat(poolB.getStatus().getNodeIds(), is(List.of(3, 4))); + assertThat(poolB.getStatus().getRoles().size(), is(1)); + assertThat(poolB.getStatus().getRoles(), hasItems(ProcessRoles.BROKER)); KafkaNodePool poolC = Crds.kafkaNodePoolOperation(client).inNamespace(NAMESPACE).withName("pool-c").get(); assertThat(poolC.getStatus().getReplicas(), is(2)); assertThat(poolC.getStatus().getNodeIds(), is(List.of(5, 6))); + assertThat(poolC.getStatus().getRoles().size(), is(1)); + assertThat(poolC.getStatus().getRoles(), hasItems(ProcessRoles.BROKER)); async.flag(); }))); @@ -658,14 +672,20 @@ public void testReconcileAndRemovePool(VertxTestContext context) { KafkaNodePool poolA = Crds.kafkaNodePoolOperation(client).inNamespace(NAMESPACE).withName("pool-a").get(); assertThat(poolA.getStatus().getReplicas(), is(3)); assertThat(poolA.getStatus().getNodeIds(), is(List.of(0, 1, 2))); + assertThat(poolA.getStatus().getRoles().size(), is(1)); + assertThat(poolA.getStatus().getRoles(), hasItems(ProcessRoles.BROKER)); KafkaNodePool poolB = Crds.kafkaNodePoolOperation(client).inNamespace(NAMESPACE).withName("pool-b").get(); assertThat(poolB.getStatus().getReplicas(), is(2)); assertThat(poolB.getStatus().getNodeIds(), is(List.of(3, 4))); + assertThat(poolB.getStatus().getRoles().size(), is(1)); + assertThat(poolB.getStatus().getRoles(), hasItems(ProcessRoles.BROKER)); KafkaNodePool poolC = Crds.kafkaNodePoolOperation(client).inNamespace(NAMESPACE).withName("pool-c").get(); assertThat(poolC.getStatus().getReplicas(), is(2)); assertThat(poolC.getStatus().getNodeIds(), is(List.of(5, 6))); + assertThat(poolC.getStatus().getRoles().size(), is(1)); + assertThat(poolC.getStatus().getRoles(), hasItems(ProcessRoles.BROKER)); // Remove pool-b Crds.kafkaNodePoolOperation(client).inNamespace(NAMESPACE).withName("pool-b").withPropagationPolicy(DeletionPropagation.FOREGROUND).delete(); diff --git a/cluster-operator/src/test/java/io/strimzi/operator/cluster/operator/assembly/KafkaAssemblyOperatorWithPoolsTest.java b/cluster-operator/src/test/java/io/strimzi/operator/cluster/operator/assembly/KafkaAssemblyOperatorWithPoolsTest.java index 6222ee91e3c..cdefbd77134 100644 --- a/cluster-operator/src/test/java/io/strimzi/operator/cluster/operator/assembly/KafkaAssemblyOperatorWithPoolsTest.java +++ b/cluster-operator/src/test/java/io/strimzi/operator/cluster/operator/assembly/KafkaAssemblyOperatorWithPoolsTest.java @@ -84,6 +84,7 @@ import java.util.function.Function; import java.util.stream.IntStream; +import static org.hamcrest.CoreMatchers.hasItems; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.nullValue; @@ -359,9 +360,13 @@ vertx, new PlatformFeaturesAvailability(false, KUBERNETES_VERSION), assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(0).getStatus().getReplicas(), is(3)); assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(0).getStatus().getNodeIds(), is(List.of(0, 1, 2))); assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(0).getStatus().getObservedGeneration(), is(1L)); + assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(0).getStatus().getRoles().size(), is(1)); + assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(0).getStatus().getRoles(), hasItems(ProcessRoles.BROKER)); assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(1).getStatus().getReplicas(), is(2)); assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(1).getStatus().getNodeIds(), is(List.of(3, 4))); assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(1).getStatus().getObservedGeneration(), is(1L)); + assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(1).getStatus().getRoles().size(), is(1)); + assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(1).getStatus().getRoles(), hasItems(ProcessRoles.BROKER)); assertThat(kao.state.kafkaStatus.getKafkaNodePools().stream().map(UsedNodePoolStatus::getName).toList(), is(List.of("pool-a", "pool-b"))); // Assert the info passed over for Cruise Control @@ -778,9 +783,13 @@ vertx, new PlatformFeaturesAvailability(false, KUBERNETES_VERSION), assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(0).getStatus().getReplicas(), is(3)); assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(0).getStatus().getNodeIds(), is(List.of(0, 1, 2))); assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(0).getStatus().getObservedGeneration(), is(1L)); + assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(0).getStatus().getRoles().size(), is(1)); + assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(0).getStatus().getRoles(), hasItems(ProcessRoles.BROKER)); assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(1).getStatus().getReplicas(), is(2)); assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(1).getStatus().getNodeIds(), is(List.of(3, 4))); assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(1).getStatus().getObservedGeneration(), is(1L)); + assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(1).getStatus().getRoles().size(), is(1)); + assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(1).getStatus().getRoles(), hasItems(ProcessRoles.BROKER)); assertThat(kao.state.kafkaStatus.getKafkaNodePools().stream().map(UsedNodePoolStatus::getName).toList(), is(List.of("pool-a", "pool-b"))); // Assert the info passed over for Cruise Control @@ -955,9 +964,13 @@ vertx, new PlatformFeaturesAvailability(false, KUBERNETES_VERSION), assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(0).getStatus().getReplicas(), is(3)); assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(0).getStatus().getNodeIds(), is(List.of(0, 1, 2))); assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(0).getStatus().getObservedGeneration(), is(1L)); + assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(0).getStatus().getRoles().size(), is(1)); + assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(0).getStatus().getRoles(), hasItems(ProcessRoles.BROKER)); assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(1).getStatus().getReplicas(), is(2)); assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(1).getStatus().getNodeIds(), is(List.of(3, 4))); assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(1).getStatus().getObservedGeneration(), is(1L)); + assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(1).getStatus().getRoles().size(), is(1)); + assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(1).getStatus().getRoles(), hasItems(ProcessRoles.BROKER)); assertThat(kao.state.kafkaStatus.getKafkaNodePools().stream().map(UsedNodePoolStatus::getName).toList(), is(List.of("pool-a", "pool-b"))); // Assert the info passed over for Cruise Control @@ -1119,11 +1132,17 @@ vertx, new PlatformFeaturesAvailability(false, KUBERNETES_VERSION), assertThat(kafkaNodePoolStatusCaptor.getAllValues().size(), is(3)); assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(0).getStatus().getReplicas(), is(3)); assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(0).getStatus().getNodeIds(), is(List.of(0, 1, 2))); + assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(0).getStatus().getRoles().size(), is(1)); + assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(0).getStatus().getRoles(), hasItems(ProcessRoles.BROKER)); assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(1).getStatus().getReplicas(), is(2)); assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(1).getStatus().getNodeIds(), is(List.of(3, 4))); + assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(1).getStatus().getRoles().size(), is(1)); + assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(1).getStatus().getRoles(), hasItems(ProcessRoles.BROKER)); assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(2).getStatus().getReplicas(), is(2)); assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(2).getStatus().getNodeIds(), is(List.of(5, 6))); assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(2).getStatus().getObservedGeneration(), is(1L)); + assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(2).getStatus().getRoles().size(), is(1)); + assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(2).getStatus().getRoles(), hasItems(ProcessRoles.BROKER)); assertThat(kao.state.kafkaStatus.getKafkaNodePools().stream().map(UsedNodePoolStatus::getName).toList(), is(List.of("pool-a", "pool-b", "pool-c"))); // Assert the info passed over for Cruise Control @@ -1295,8 +1314,12 @@ vertx, new PlatformFeaturesAvailability(false, KUBERNETES_VERSION), assertThat(kafkaNodePoolStatusCaptor.getAllValues().size(), is(2)); assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(0).getStatus().getReplicas(), is(3)); assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(0).getStatus().getNodeIds(), is(List.of(0, 1, 2))); + assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(0).getStatus().getRoles().size(), is(1)); + assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(0).getStatus().getRoles(), hasItems(ProcessRoles.BROKER)); assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(1).getStatus().getReplicas(), is(2)); assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(1).getStatus().getNodeIds(), is(List.of(3, 4))); + assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(1).getStatus().getRoles().size(), is(1)); + assertThat(kafkaNodePoolStatusCaptor.getAllValues().get(1).getStatus().getRoles(), hasItems(ProcessRoles.BROKER)); assertThat(kao.state.kafkaStatus.getKafkaNodePools().stream().map(UsedNodePoolStatus::getName).toList(), is(List.of("pool-a", "pool-b"))); // Assert the info passed over for Cruise Control diff --git a/documentation/modules/appendix_crds.adoc b/documentation/modules/appendix_crds.adoc index 9a72964ab79..30b1cc198f8 100644 --- a/documentation/modules/appendix_crds.adoc +++ b/documentation/modules/appendix_crds.adoc @@ -3499,6 +3499,8 @@ Used in: xref:type-KafkaNodePool-{context}[`KafkaNodePool`] |integer array |clusterId 1.2+<.