-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
After the container has been started the second time around the health checks fail ,because now certain apis require authentication.
The culprit lies in containerIsStarting()
:
waitUntilNodeIsOnline()
fails the second time around because configureAdminUser()
has already been called which now protects the api used in waitUntilNodeIsOnline()
.
Our current work around looks something like this:
final CouchbaseContainer couchbase = new CouchbaseContainer("couchbase:enterprise-6.5.0") {
@Override
protected void configure() {
super.configure();
// needed because a random network alias is assigned in addition to anything we try to set withNetworkAliases("couchbase") which causes the hash comparision to fail.
setNetworkAliases(Collections.singletonList("couchbase"));
}
@Override
protected void containerIsStarting(final InspectContainerResponse containerInfo, final boolean reused) {
if (!reused) {
super.containerIsStarting(containerInfo, reused);
}
}
@Override
protected void containerIsStarted(final InspectContainerResponse containerInfo, final boolean reused) {
if (!reused) {
super.containerIsStarted(containerInfo, reused);
} else {
this.logger().info("Couchbase container is ready! UI available at http://{}:{}", this.getHost(), this.getMappedPort(8091));
}
}
}
It would be good if the correct fix was applied upstream, so that others may take advantage of CouchbaseContainer
and .withReuse(true)
.
captainhorsepower