fix(msk): create a serverless cluster without Docker as a provisioned one is (#5808)

This commit is contained in:
Niels Kootstra authored and GitHub committed 2026-10-16 13:40:31 -04:00
1 parent c67a5afbc3
commit 9cd8b32670
3 files changed
+58 -16

No files matched your search

@@ -167,16 +167,7 @@ public class MskService implements ResourceProvider {
cluster.getCurrentBrokerSoftwareInfo().setConfigurationRevision(configurationInfo.getRevision());
}
if (config.services().msk().mock()) {
cluster.setState(ClusterState.ACTIVE);
cluster.setBootstrapBrokers("localhost:9092");
} else if (!redpandaManager.tryStartContainer(cluster)) {
LOG.warnv("MSK cluster {0} created without a backing Kafka broker: no Docker daemon "
+ "is reachable. Metadata operations work; producing and consuming do not "
+ "until a daemon appears.", clusterName);
cluster.setState(ClusterState.ACTIVE);
cluster.setBootstrapBrokers("localhost:9092");
}
startBroker(cluster);
storage.put(clusterArn, cluster);
return cluster;
@@ -220,6 +211,19 @@ public class MskService implements ResourceProvider {
return createCluster(merged);
}
private void startBroker(MskCluster cluster) {
if (config.services().msk().mock()) {
cluster.setState(ClusterState.ACTIVE);
cluster.setBootstrapBrokers("localhost:9092");
} else if (!redpandaManager.tryStartContainer(cluster)) {
LOG.warnv("MSK cluster {0} created without a backing Kafka broker: no Docker daemon "
+ "is reachable. Metadata operations work; producing and consuming do not "
+ "until a daemon appears.", cluster.getClusterName());
cluster.setState(ClusterState.ACTIVE);
cluster.setBootstrapBrokers("localhost:9092");
}
}
/**
* Rejects the CreateCluster input AWS rejects.
*
@@ -360,12 +364,7 @@ public class MskService implements ResourceProvider {
cluster.setZookeeperConnectString(null);
cluster.setCurrentBrokerSoftwareInfo(null);
if (config.services().msk().mock()) {
cluster.setState(ClusterState.ACTIVE);
cluster.setBootstrapBrokers("localhost:9092");
} else {
redpandaManager.startContainer(cluster);
}
startBroker(cluster);
storage.put(clusterArn, cluster);
return cluster;