KubectlClient::Wait
Using sleep() to wait for terminating resources is unreliable.
-
Resources still in terminating state can interfere with test runs. and result in failures of the next test (or spec test).
-
Helm uninstall wait option and kubectl delete wait options, do not wait for child resources to be fully deleted.
-
The output from kubectl json does not clearly indicate when a resource is in a terminating state. To wait for uninstall, we can use the app.kubernetes.io/name label, to lookup resources belonging to a CNF to wait for uninstall. We only use this helper in the spec tests, so we use the "kubectl get" output to keep things simple.
Class methods
resource_wait_for_install(kind : String, resource_name : String, wait_count : Int32 = 180, namespace : String = "default") : Bool
Sourceresource_wait_for_uninstall(kind : String, resource_name : String, wait_count : Int32 = 180, namespace : String | Nil = "default") : Bool
TODO add parameter and functionality that checks for individual pods to be successfully terminated
wait_for_condition(kind : String, resource_name : String, condition : String, wait_count : Int32 = 180, namespace : String | Nil = nil)
Sourcewait_for_resource_availability(kind : String, resource_name : String, namespace = "default", wait_count : Int32 = 180) : Bool
Source