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

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