|
11 | 11 | import io.strimzi.api.kafka.model.kafka.Kafka;
|
12 | 12 | import io.strimzi.api.kafka.model.kafka.cruisecontrol.CruiseControlResources;
|
13 | 13 | import io.strimzi.api.kafka.model.rebalance.KafkaRebalance;
|
| 14 | +import io.strimzi.api.kafka.model.rebalance.KafkaRebalanceAnnotation; |
| 15 | +import io.strimzi.api.kafka.model.rebalance.KafkaRebalanceState; |
14 | 16 | import io.strimzi.operator.common.Annotations;
|
15 | 17 | import io.strimzi.operator.common.model.Labels;
|
16 | 18 | import io.strimzi.systemtest.AbstractST;
|
|
36 | 38 | import io.strimzi.systemtest.templates.specific.ScraperTemplates;
|
37 | 39 | import io.strimzi.systemtest.utils.ClientUtils;
|
38 | 40 | import io.strimzi.systemtest.utils.RollingUpdateUtils;
|
39 |
| -import io.strimzi.systemtest.utils.TestKafkaVersion; |
40 | 41 | import io.strimzi.systemtest.utils.kafkaUtils.KafkaConnectUtils;
|
41 | 42 | import io.strimzi.systemtest.utils.kafkaUtils.KafkaRebalanceUtils;
|
42 | 43 | import io.strimzi.systemtest.utils.kafkaUtils.KafkaUtils;
|
@@ -253,8 +254,6 @@ void testMultipleCOsInDifferentNamespaces() {
|
253 | 254 | @SuppressWarnings("deprecation") // Replicas in Kafka CR are deprecated, but some API methods are still called here
|
254 | 255 | void testKafkaCCAndRebalanceWithMultipleCOs() {
|
255 | 256 | assumeFalse(Environment.isNamespaceRbacScope());
|
256 |
| - // Currently not supported on Kafka 4.0.0 |
257 |
| - assumeTrue(TestKafkaVersion.compareDottedVersions(Environment.ST_KAFKA_VERSION, "4.0.0") < 0); |
258 | 257 | final TestStorage testStorage = new TestStorage(ResourceManager.getTestContext(), DEFAULT_NAMESPACE);
|
259 | 258 |
|
260 | 259 | int scaleTo = 4;
|
@@ -335,6 +334,12 @@ void testKafkaCCAndRebalanceWithMultipleCOs() {
|
335 | 334 |
|
336 | 335 | KafkaUtils.waitForClusterStability(testStorage.getNamespaceName(), testStorage.getClusterName());
|
337 | 336 |
|
| 337 | + // Refresh the KafkaRebalance to make sure it's not in `NotReady` state due to CruiseControlRestException |
| 338 | + // This can happen if the new Cruise Control pod was not up and request was propagated to old Cruise Control |
| 339 | + if (KafkaRebalanceUtils.rebalanceStateCondition(testStorage.getNamespaceName(), testStorage.getClusterName()).getType().equals(KafkaRebalanceState.NotReady.name())) { |
| 340 | + KafkaRebalanceUtils.annotateKafkaRebalanceResource(testStorage.getNamespaceName(), testStorage.getClusterName(), KafkaRebalanceAnnotation.refresh); |
| 341 | + } |
| 342 | + |
338 | 343 | KafkaRebalanceUtils.doRebalancingProcess(testStorage.getNamespaceName(), testStorage.getClusterName());
|
339 | 344 |
|
340 | 345 | LOGGER.info("Verifying that operands are operated by expected Cluster Operator {}", FIRST_CO_NAME);
|
|
0 commit comments