Skip to content

Commit

Permalink
Add WARN log if provided Couchbase password offends default policy (#936
Browse files Browse the repository at this point in the history
)

Add WARN log if provided Couchbase password doesn't meet requirements

See #934
  • Loading branch information
kiview authored Oct 28, 2018
1 parent 5af0a75 commit eaa21aa
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ public class CouchbaseContainer extends GenericContainer<CouchbaseContainer> {
public static final String STATIC_CONFIG = "/opt/couchbase/etc/couchbase/static_config";
public static final String CAPI_CONFIG = "/opt/couchbase/etc/couchdb/default.d/capi.ini";

private static final int REQUIRED_DEFAULT_PASSWORD_LENGTH = 6;

private String memoryQuota = "300";

private String indexMemoryQuota = "300";
Expand Down Expand Up @@ -118,6 +120,14 @@ public Set<Integer> getLivenessCheckPortNumbers() {
return Sets.newHashSet(getMappedPort(REST));
}

@Override
protected void configure() {
if (clusterPassword.length() < REQUIRED_DEFAULT_PASSWORD_LENGTH) {
logger().warn("The provided cluster admin password length is less then the default password policy length. " +
"Cluster start will fail if configured password requirements are not met.");
}
}

@Override
@SneakyThrows
protected void doStart() {
Expand Down

0 comments on commit eaa21aa

Please sign in to comment.