Skip to content

Commit cf611b2

Browse files
committed
fix handling of shared container
1 parent cf3ec67 commit cf611b2

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

tests/integration/src/test/java/org/apache/pulsar/tests/integration/topologies/PulsarCluster.java

+5-12
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,7 @@ public class PulsarCluster {
7272
* @return the built pulsar cluster
7373
*/
7474
public static PulsarCluster forSpec(PulsarClusterSpec spec) {
75-
CSContainer csContainer = null;
76-
if (!spec.enableOxia) {
77-
csContainer = new CSContainer(spec.clusterName)
78-
.withNetwork(Network.newNetwork())
79-
.withNetworkAliases(CSContainer.NAME);
80-
}
81-
return new PulsarCluster(spec, null, csContainer, false);
75+
return forSpec(spec, Network.newNetwork());
8276
}
8377

8478
public static PulsarCluster forSpec(PulsarClusterSpec spec, Network network) {
@@ -93,7 +87,7 @@ public static PulsarCluster forSpec(PulsarClusterSpec spec, Network network) {
9387
}
9488

9589
public static PulsarCluster forSpec(PulsarClusterSpec spec, CSContainer csContainer) {
96-
return new PulsarCluster(spec, null, csContainer, true);
90+
return new PulsarCluster(spec, csContainer.getNetwork(), csContainer, true);
9791
}
9892

9993
@Getter
@@ -121,13 +115,12 @@ public static PulsarCluster forSpec(PulsarClusterSpec spec, CSContainer csContai
121115
private final String configurationMetadataStoreUrl;
122116

123117
private PulsarCluster(PulsarClusterSpec spec, Network network, CSContainer csContainer, boolean sharedCsContainer) {
124-
125118
this.spec = spec;
126119
this.sharedCsContainer = sharedCsContainer;
127120
this.clusterName = spec.clusterName();
128121
if (network != null) {
129122
this.network = network;
130-
} else if (csContainer != null ) {
123+
} else if (csContainer != null) {
131124
this.network = csContainer.getNetwork();
132125
} else {
133126
this.network = Network.newNetwork();
@@ -277,7 +270,7 @@ private PulsarCluster(PulsarClusterSpec spec, Network network, CSContainer csCon
277270
));
278271

279272
if (spec.dataContainer != null) {
280-
if (csContainer != null) {
273+
if (!sharedCsContainer && csContainer != null) {
281274
csContainer.withVolumesFrom(spec.dataContainer, BindMode.READ_WRITE);
282275
}
283276
if (zkContainer != null) {
@@ -294,7 +287,7 @@ private PulsarCluster(PulsarClusterSpec spec, Network network, CSContainer csCon
294287
if (zkContainer != null) {
295288
zkContainer.withClasspathResourceMapping(key, value, BindMode.READ_WRITE);
296289
}
297-
if (csContainer != null) {
290+
if (!sharedCsContainer && csContainer != null) {
298291
csContainer.withClasspathResourceMapping(key, value, BindMode.READ_WRITE);
299292
}
300293
proxyContainer.withClasspathResourceMapping(key, value, BindMode.READ_WRITE);

tests/integration/src/test/java/org/apache/pulsar/tests/integration/topologies/PulsarClusterSpec.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public class PulsarClusterSpec {
125125
Map<String, String> classPathVolumeMounts = new TreeMap<>();
126126

127127
/**
128-
* Daat container
128+
* Data container
129129
*/
130130
@Builder.Default
131131
GenericContainer<?> dataContainer = null;

0 commit comments

Comments
 (0)