module

KubectlClient::Wait

Using sleep() to wait for terminating resources is unreliable.

  1. Resources still in terminating state can interfere with test runs. and result in failures of the next test (or spec test).

  2. Helm uninstall wait option and kubectl delete wait options, do not wait for child resources to be fully deleted.

  3. 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
Source
resource_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

Source
wait_for_condition(kind : String, resource_name : String, condition : String, wait_count : Int32 = 180, namespace : String | Nil = nil)
Source
wait_for_install_by_apply(manifest_file : String, wait_count : Int32 = 180) : Bool
Source
wait_for_resource_availability(kind : String, resource_name : String, namespace = "default", wait_count : Int32 = 180) : Bool
Source
wait_for_resource_key_value(kind : String, resource_name : String, dig_params : Tuple, value : String | Nil = nil, wait_count : Int32 = 180, namespace : String = "default") : Bool
Source
wait_for_terminations(namespace : String | Nil = nil, wait_count : Int32 = 30) : Bool
Source