DBZ-6875 Ensuring root user is created when using authenticated mongo rs

This commit is contained in:
Jakub Cechacek 2023-11-07 20:50:15 +01:00 committed by Jiri Pechanec
parent 83e6f28e41
commit 2f70c30962

View File

@ -270,6 +270,9 @@ public void start() {
// Create rootUser // Create rootUser
LOGGER.info("[{}] Creating root user...", name); LOGGER.info("[{}] Creating root user...", name);
createRootUser(); createRootUser();
// Make sure RS status is available to root user
awaitReplicaPrimary();
started = true; started = true;
} }
@ -329,6 +332,7 @@ public void awaitReplicaPrimary() {
await() await()
.atMost(1, MINUTES) .atMost(1, MINUTES)
.pollDelay(1, SECONDS) .pollDelay(1, SECONDS)
.ignoreException(IllegalArgumentException.class)
.until(() -> tryPrimary().isPresent()); .until(() -> tryPrimary().isPresent());
} }