DBZ-4395 Add connector specific Debezium Connect REST Extension/s and move logic from UI backend to the Debezium Connect REST Extension (part 1 of the re-architecturing/re-factoring)

* fix that Docker networks should not be closed by MongoDb container managers (MongoDbReplicaSet and MongoDbShardedCluster)

closes to https://issues.redhat.com/browse/DBZ-4395
This commit is contained in:
rkerner 2023-08-29 19:38:16 +02:00 committed by Jiri Pechanec
parent 32161c9874
commit 5292096903
3 changed files with 5 additions and 9 deletions

View File

@ -5,9 +5,6 @@
*/
package io.debezium.testing.testcontainers;
import static io.debezium.testing.testcontainers.util.DockerUtils.addFakeDnsEntry;
import static io.debezium.testing.testcontainers.util.DockerUtils.isDockerDesktop;
import static io.debezium.testing.testcontainers.util.DockerUtils.logDockerDesktopBanner;
import static java.util.stream.Collectors.joining;
import static java.util.stream.IntStream.range;
@ -178,7 +175,7 @@ private MongoDbContainer(Builder builder) {
this.authEnabled = builder.authEnabled;
this.configAddress = builder.configAddress;
if (isDockerDesktop()) {
if (DockerUtils.isDockerDesktop()) {
this.port = portResolver.resolveFreePort();
addFixedExposedPort(port, port);
}
@ -186,7 +183,7 @@ private MongoDbContainer(Builder builder) {
this.port = builder.port;
}
logDockerDesktopBanner(LOGGER, List.of(name), builder.skipDockerDesktopLogWarning);
DockerUtils.logDockerDesktopBanner(LOGGER, List.of(name), builder.skipDockerDesktopLogWarning);
withNetwork(builder.network);
withNetworkAliases(name);
@ -228,7 +225,7 @@ public Address getClientAddress() {
checkStarted();
// Technically we only need to do this for Mac
if (isDockerDesktop()) {
if (DockerUtils.isDockerDesktop()) {
return getNamedAddress();
}
@ -392,7 +389,7 @@ private void checkStarted() {
@Override
protected void containerIsStarted(InspectContainerResponse containerInfo) {
super.containerIsStarted(containerInfo);
addFakeDnsEntry(name);
DockerUtils.addFakeDnsEntry(name);
}
/**

View File

@ -280,7 +280,7 @@ public void start() {
public void stop() {
LOGGER.info("[{}] Stopping...", name);
MoreStartables.deepStopSync(members.stream());
network.close();
started = false;
}
private void initializeReplicaSet() {

View File

@ -148,7 +148,6 @@ public void stop() {
// Idempotent
LOGGER.info("Stopping {} shard cluster...", shards.size());
MoreStartables.deepStopSync(stream());
network.close();
}
public int size() {