Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -241,22 +241,7 @@ public String getConnectionString() {
protected void configure() {
super.configure();

addExposedPorts(
MGMT_PORT,
MGMT_SSL_PORT,
VIEW_PORT,
VIEW_SSL_PORT,
QUERY_PORT,
QUERY_SSL_PORT,
SEARCH_PORT,
SEARCH_SSL_PORT,
ANALYTICS_PORT,
ANALYTICS_SSL_PORT,
KV_PORT,
KV_SSL_PORT,
EVENTING_PORT,
EVENTING_SSL_PORT
);
exposePorts();

WaitAllStrategy waitStrategy = new WaitAllStrategy();

Expand Down Expand Up @@ -319,6 +304,34 @@ protected void configure() {
waitingFor(waitStrategy);
}

/**
* Configures the exposed ports based on the enabled services.
* <p>
* Note that the MGMT_PORTs are always enabled since there must always be a cluster
* manager. Also, the View engine ports are implicitly available on the same nodes
* where the KV service is enabled - it is not possible to configure them individually.
*/
private void exposePorts() {
addExposedPorts(MGMT_PORT, MGMT_SSL_PORT);

if (enabledServices.contains(CouchbaseService.KV)) {
addExposedPorts(KV_PORT, KV_SSL_PORT);
addExposedPorts(VIEW_PORT, VIEW_SSL_PORT);
}
if (enabledServices.contains(CouchbaseService.ANALYTICS)) {
addExposedPorts(ANALYTICS_PORT, ANALYTICS_SSL_PORT);
}
if (enabledServices.contains(CouchbaseService.QUERY)) {
addExposedPorts(QUERY_PORT, QUERY_SSL_PORT);
}
if (enabledServices.contains(CouchbaseService.SEARCH)) {
addExposedPorts(SEARCH_PORT, SEARCH_SSL_PORT);
}
if (enabledServices.contains(CouchbaseService.EVENTING)) {
addExposedPorts(EVENTING_PORT, EVENTING_SSL_PORT);
}
}

@Override
protected void containerIsStarting(final InspectContainerResponse containerInfo) {
logger().debug("Couchbase container is starting, performing configuration.");
Expand Down