Fixes mistake in WaitUntilOnline method

This commit is contained in:
benbierens 2023-03-20 08:13:19 +01:00
parent 63d1d9b451
commit 47bf4bf48b
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
1 changed files with 7 additions and 7 deletions

View File

@ -84,9 +84,11 @@ namespace CodexDistTests.TestCore
private void WaitUntilOnline(ActiveNode activeNode, Kubernetes client)
{
WaitUntil(() =>
activeNode.Deployment?.Status.AvailableReplicas != null &&
activeNode.Deployment.Status.AvailableReplicas > 0);
WaitUntil(() =>
{
activeNode.Deployment = client.ReadNamespacedDeployment(activeNode.Deployment.Name(), k8sNamespace);
return activeNode.Deployment?.Status.AvailableReplicas != null && activeNode.Deployment.Status.AvailableReplicas > 0;
});
}
private void WaitUntilOffline(string deploymentName, Kubernetes client)
@ -100,14 +102,12 @@ namespace CodexDistTests.TestCore
private void WaitUntilZeroPods(Kubernetes client)
{
WaitUntil(() =>
!client.ListNamespacedPod(k8sNamespace).Items.Any());
WaitUntil(() => !client.ListNamespacedPod(k8sNamespace).Items.Any());
}
private void WaitUntilNamespaceDeleted(Kubernetes client)
{
WaitUntil(() =>
client.ListNamespace().Items.All(n => n.Metadata.Name != k8sNamespace));
WaitUntil(() => client.ListNamespace().Items.All(n => n.Metadata.Name != k8sNamespace));
}
private void WaitUntil(Func<bool> predicate)