checking service status before proceeding

This commit is contained in:
benbierens 2023-03-19 08:22:38 +01:00
parent 906833aa6d
commit b4ab5798f3
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
2 changed files with 16 additions and 0 deletions

View File

@ -106,6 +106,11 @@ namespace CodexDistTests.TestCore
activeService = client.CreateNamespacedService(serviceSpec, k8sNamespace);
// todo: wait until online!
while (activeDeployment.Status.AvailableReplicas == null || activeDeployment.Status.AvailableReplicas != 1)
{
Timing.WaitForServiceDelay();
activeDeployment = client.ReadNamespacedDeployment(activeDeployment.Name(), k8sNamespace);
}
}
public CodexNode GetCodexNode()
@ -123,6 +128,12 @@ namespace CodexDistTests.TestCore
client.DeleteNamespace(activeNamespace.Name());
// todo: wait until terminated!
var pods = client.ListNamespacedPod(k8sNamespace);
while (pods.Items.Any())
{
Timing.WaitForServiceDelay();
pods = client.ListNamespacedPod(k8sNamespace);
}
}
}
}

View File

@ -11,5 +11,10 @@
{
Utils.Sleep(TimeSpan.FromSeconds(3));
}
public static void WaitForServiceDelay()
{
Utils.Sleep(TimeSpan.FromSeconds(1));
}
}
}