@@ -72,13 +72,7 @@ public class PulsarCluster {
72
72
* @return the built pulsar cluster
73
73
*/
74
74
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 ());
82
76
}
83
77
84
78
public static PulsarCluster forSpec (PulsarClusterSpec spec , Network network ) {
@@ -93,7 +87,7 @@ public static PulsarCluster forSpec(PulsarClusterSpec spec, Network network) {
93
87
}
94
88
95
89
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 );
97
91
}
98
92
99
93
@ Getter
@@ -121,13 +115,12 @@ public static PulsarCluster forSpec(PulsarClusterSpec spec, CSContainer csContai
121
115
private final String configurationMetadataStoreUrl ;
122
116
123
117
private PulsarCluster (PulsarClusterSpec spec , Network network , CSContainer csContainer , boolean sharedCsContainer ) {
124
-
125
118
this .spec = spec ;
126
119
this .sharedCsContainer = sharedCsContainer ;
127
120
this .clusterName = spec .clusterName ();
128
121
if (network != null ) {
129
122
this .network = network ;
130
- } else if (csContainer != null ) {
123
+ } else if (csContainer != null ) {
131
124
this .network = csContainer .getNetwork ();
132
125
} else {
133
126
this .network = Network .newNetwork ();
@@ -277,7 +270,7 @@ private PulsarCluster(PulsarClusterSpec spec, Network network, CSContainer csCon
277
270
));
278
271
279
272
if (spec .dataContainer != null ) {
280
- if (csContainer != null ) {
273
+ if (! sharedCsContainer && csContainer != null ) {
281
274
csContainer .withVolumesFrom (spec .dataContainer , BindMode .READ_WRITE );
282
275
}
283
276
if (zkContainer != null ) {
@@ -294,7 +287,7 @@ private PulsarCluster(PulsarClusterSpec spec, Network network, CSContainer csCon
294
287
if (zkContainer != null ) {
295
288
zkContainer .withClasspathResourceMapping (key , value , BindMode .READ_WRITE );
296
289
}
297
- if (csContainer != null ) {
290
+ if (! sharedCsContainer && csContainer != null ) {
298
291
csContainer .withClasspathResourceMapping (key , value , BindMode .READ_WRITE );
299
292
}
300
293
proxyContainer .withClasspathResourceMapping (key , value , BindMode .READ_WRITE );
0 commit comments