Skip to content

Commit

Permalink
Add/Update warnings for Zoo and MM1 removal (strimzi#10828)
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Scholz <www@scholzj.com>
  • Loading branch information
scholzj authored and ocorriga committed Dec 6, 2024
1 parent 32dc069 commit 23edd6c
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
Remove support for Kafka 3.7.0 and 3.7.1
* Ability to move data between JBOD disks using Cruise Control.

### Major changes, deprecations and removals

* **Strimzi 0.45 is the last minor Strimzi version with support for ZooKeeper-based Apache Kafka clusters and MirrorMaker 1 deployments.**
**Please make sure to migrate to KRaft and MirrorMaker 2 before upgrading to Strimzi 0.46 or newer.**

## 0.44.0

* Add the "Unmanaged" KafkaTopic status update.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ Future<Void> reconcile(ReconciliationState reconcileState) {
return Future.failedFuture(e);
}
} else {
// Add warning about upcoming ZooKeeper removal
LOGGER.warnCr(reconcileState.reconciliation, "Support for ZooKeeper-based Apache Kafka clusters will be removed in the next Strimzi release (0.46.0). Please migrate to KRaft.");
StatusUtils.addConditionsToStatus(reconcileState.kafkaStatus, Set.of(StatusUtils.buildWarningCondition("ZooKeeperRemoval", "Support for ZooKeeper-based Apache Kafka clusters will be removed in the next Strimzi release (0.46.0). Please migrate to KRaft.")));

// Validates the properties required for a ZooKeeper based Kafka cluster
try {
KRaftUtils.validateKafkaCrForZooKeeper(reconcileState.kafkaAssembly.getSpec(), nodePoolsEnabled);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ protected Future<KafkaMirrorMakerStatus> createOrUpdate(Reconciliation reconcili
StatusUtils.setStatusConditionAndObservedGeneration(assemblyResource, kafkaMirrorMakerStatus, reconciliationResult.cause());

// Add warning about Mirror Maker 1 being deprecated and removed soon
LOGGER.warnCr(reconciliation, "Mirror Maker 1 is deprecated and will be removed in Apache Kafka 4.0.0. Please migrate to Mirror Maker 2.");
StatusUtils.addConditionsToStatus(kafkaMirrorMakerStatus, Set.of(StatusUtils.buildWarningCondition("MirrorMaker1Deprecation", "Mirror Maker 1 is deprecated and will be removed in Apache Kafka 4.0.0. Please migrate to Mirror Maker 2.")));
LOGGER.warnCr(reconciliation, "MirrorMaker 1 is deprecated and will be removed in the next Strimzi release (0.46.0). Please migrate to MirrorMaker 2.");
StatusUtils.addConditionsToStatus(kafkaMirrorMakerStatus, Set.of(StatusUtils.buildWarningCondition("MirrorMaker1Deprecation", "MirrorMaker 1 is deprecated and will be removed in the next Strimzi release (0.46.0). Please migrate to MirrorMaker 2.")));

kafkaMirrorMakerStatus.setReplicas(mirror.getReplicas());
kafkaMirrorMakerStatus.setLabelSelector(mirror.getSelectorLabels().toSelectorString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import io.fabric8.openshift.api.model.RouteStatusBuilder;
import io.micrometer.core.instrument.Meter;
import io.micrometer.core.instrument.MeterRegistry;
import io.strimzi.api.kafka.model.common.Condition;
import io.strimzi.api.kafka.model.common.InlineLogging;
import io.strimzi.api.kafka.model.common.jmx.KafkaJmxAuthenticationPasswordBuilder;
import io.strimzi.api.kafka.model.common.jmx.KafkaJmxOptions;
Expand Down Expand Up @@ -129,6 +130,7 @@
import static java.util.Collections.emptyMap;
import static java.util.Collections.singletonMap;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasKey;
import static org.hamcrest.Matchers.hasSize;
Expand Down Expand Up @@ -758,6 +760,10 @@ private void createCluster(VertxTestContext context, Kafka kafka, List<Secret> s

assertThat(status.getOperatorLastSuccessfulVersion(), is(KafkaAssemblyOperator.OPERATOR_VERSION));

Condition zooRemovalWarning = status.getConditions().stream().filter(c -> "ZooKeeperRemoval".equals(c.getReason())).findFirst().orElse(null);
assertThat(zooRemovalWarning, is(notNullValue()));
assertThat(zooRemovalWarning.getMessage(), is("Support for ZooKeeper-based Apache Kafka clusters will be removed in the next Strimzi release (0.46.0). Please migrate to KRaft."));

async.flag();
})));
}
Expand Down Expand Up @@ -1274,6 +1280,10 @@ private void updateCluster(VertxTestContext context, Kafka originalAssembly, Kaf
assertThat(status.getOperatorLastSuccessfulVersion(), is(KafkaAssemblyOperator.OPERATOR_VERSION));
assertThat(status.getKafkaVersion(), is(VERSIONS.defaultVersion().version()));

Condition zooRemovalWarning = status.getConditions().stream().filter(c -> "ZooKeeperRemoval".equals(c.getReason())).findFirst().orElse(null);
assertThat(zooRemovalWarning, is(notNullValue()));
assertThat(zooRemovalWarning.getMessage(), is("Support for ZooKeeper-based Apache Kafka clusters will be removed in the next Strimzi release (0.46.0). Please migrate to KRaft."));

async.flag();
})));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public void testCreateCluster(VertxTestContext context) {
assertThat(mm.getStatus().getConditions().get(1).getType(), is("Warning"));
assertThat(mm.getStatus().getConditions().get(1).getReason(), is("MirrorMaker1Deprecation"));
assertThat(mm.getStatus().getConditions().get(1).getStatus(), is("True"));
assertThat(mm.getStatus().getConditions().get(1).getMessage(), is("Mirror Maker 1 is deprecated and will be removed in Apache Kafka 4.0.0. Please migrate to Mirror Maker 2."));
assertThat(mm.getStatus().getConditions().get(1).getMessage(), is("MirrorMaker 1 is deprecated and will be removed in the next Strimzi release (0.46.0). Please migrate to MirrorMaker 2."));

async.flag();
})));
Expand Down Expand Up @@ -656,7 +656,7 @@ public void testCreateClusterStatusNotReady(VertxTestContext context) {
assertThat(mm.getStatus().getConditions().get(1).getType(), is("Warning"));
assertThat(mm.getStatus().getConditions().get(1).getReason(), is("MirrorMaker1Deprecation"));
assertThat(mm.getStatus().getConditions().get(1).getStatus(), is("True"));
assertThat(mm.getStatus().getConditions().get(1).getMessage(), is("Mirror Maker 1 is deprecated and will be removed in Apache Kafka 4.0.0. Please migrate to Mirror Maker 2."));
assertThat(mm.getStatus().getConditions().get(1).getMessage(), is("MirrorMaker 1 is deprecated and will be removed in the next Strimzi release (0.46.0). Please migrate to MirrorMaker 2."));

async.flag();
})));
Expand Down Expand Up @@ -716,7 +716,7 @@ public void testCreateOrUpdateZeroReplica(VertxTestContext context) {
assertThat(mm.getStatus().getConditions().get(1).getType(), is("Warning"));
assertThat(mm.getStatus().getConditions().get(1).getReason(), is("MirrorMaker1Deprecation"));
assertThat(mm.getStatus().getConditions().get(1).getStatus(), is("True"));
assertThat(mm.getStatus().getConditions().get(1).getMessage(), is("Mirror Maker 1 is deprecated and will be removed in Apache Kafka 4.0.0. Please migrate to Mirror Maker 2."));
assertThat(mm.getStatus().getConditions().get(1).getMessage(), is("MirrorMaker 1 is deprecated and will be removed in the next Strimzi release (0.46.0). Please migrate to MirrorMaker 2."));

async.flag();
})));
Expand Down

0 comments on commit 23edd6c

Please # to comment.