Skip to content

Commit eaa21aa

Browse files
authored
Add WARN log if provided Couchbase password offends default policy (#936)
Add WARN log if provided Couchbase password doesn't meet requirements See #934
1 parent 5af0a75 commit eaa21aa

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ public class CouchbaseContainer extends GenericContainer<CouchbaseContainer> {
6767
public static final String STATIC_CONFIG = "/opt/couchbase/etc/couchbase/static_config";
6868
public static final String CAPI_CONFIG = "/opt/couchbase/etc/couchdb/default.d/capi.ini";
6969

70+
private static final int REQUIRED_DEFAULT_PASSWORD_LENGTH = 6;
71+
7072
private String memoryQuota = "300";
7173

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

123+
@Override
124+
protected void configure() {
125+
if (clusterPassword.length() < REQUIRED_DEFAULT_PASSWORD_LENGTH) {
126+
logger().warn("The provided cluster admin password length is less then the default password policy length. " +
127+
"Cluster start will fail if configured password requirements are not met.");
128+
}
129+
}
130+
121131
@Override
122132
@SneakyThrows
123133
protected void doStart() {

0 commit comments

Comments
 (0)