k8s_client v0.1.3 K8s.Client.Wait

Waiting functionality for K8s.Client

Link to this section Summary

Types

t()

A wait configuration

Functions

Continually perform a GET based operation until a condition is met

Link to this section Types

Link to this type

t()
t() :: %K8s.Client.Wait{
  eval: any() | (any() -> any()),
  find: [binary()] | (any() -> any()),
  processor: (map(), map() -> {:ok, map()} | {:error, binary()}),
  sleep: pos_integer(),
  timeout: pos_integer(),
  timeout_after: NaiveDateTime.t()
}

A wait configuration

Link to this section Functions

Link to this function

until(op, conf, opts)
until(K8s.Client.Operation.t(), map(), keyword(atom())) ::
  {:ok, map()} | {:error, binary()}

Continually perform a GET based operation until a condition is met.

Example

Checking the number of job completions:

op = K8s.Client.get("batch/v1", :job, namespace: "default", name: "sleep")
conf = K8s.Conf.from_file("~/.kube/config")

opts = [find: ["status", "succeeded"], eval: 1, timeout: 60]
resp = K8s.Client.Wait.until(op, conf, opts)