Skip to content

Commit 63dea7a

Browse files
Added support for reuse to couchbase container
#2794
1 parent 6139e5e commit 63dea7a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

modules/couchbase/AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
Tayeb Chlyah <[email protected]>
22
Tobias Happ <[email protected]>
3+
Fredrik Albihn <[email protected]>

modules/couchbase/src/main/java/org/testcontainers/couchbase/CouchbaseContainer.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,15 @@ private void exposePorts() {
341341
}
342342
}
343343

344+
@Override
345+
protected void containerIsStarting(InspectContainerResponse containerInfo, boolean reused) {
346+
if (reused) {
347+
this.logger().debug("Couchbase container is being reused, assuming correct configuration.");
348+
} else {
349+
containerIsStarting(containerInfo);
350+
}
351+
}
352+
344353
@Override
345354
protected void containerIsStarting(final InspectContainerResponse containerInfo) {
346355
logger().debug("Couchbase container is starting, performing configuration.");
@@ -359,6 +368,16 @@ protected void containerIsStarting(final InspectContainerResponse containerInfo)
359368
}
360369
}
361370

371+
@Override
372+
protected void containerIsStarted(InspectContainerResponse containerInfo, boolean reused) {
373+
if (reused) {
374+
logger()
375+
.info("Couchbase container reused and ready! UI available at http://{}:{}", getHost(), getMappedPort(MGMT_PORT));
376+
} else {
377+
this.containerIsStarted(containerInfo);
378+
}
379+
}
380+
362381
@Override
363382
protected void containerIsStarted(InspectContainerResponse containerInfo) {
364383
timePhase("createBuckets", this::createBuckets);

0 commit comments

Comments
 (0)