use of io.stackgres.common.crd.sgcluster.ClusterDbOpsRestartStatus in project stackgres by ongres.
the class ClusterStateHandlerTest method verifyClusterInitializedStatus.
protected void verifyClusterInitializedStatus(List<Pod> pods, StackGresCluster cluster) {
List<String> expectedInitialInstances = pods.stream().map(Pod::getMetadata).map(ObjectMeta::getName).sorted(String::compareTo).collect(Collectors.toUnmodifiableList());
final ClusterDbOpsRestartStatus initializedSecurityUpgradeStatus = getRestartStatus(cluster).orElseThrow();
Pod primaryPod = pods.stream().filter(pod -> pod.getMetadata().getName().endsWith("-0")).findAny().get();
assertEquals(primaryPod.getMetadata().getName(), initializedSecurityUpgradeStatus.getPrimaryInstance());
List<String> actualInitialInstances = initializedSecurityUpgradeStatus.getInitialInstances();
assertEquals(expectedInitialInstances, actualInitialInstances);
}
Aggregations