View Source K8s.Client.Runner.Wait (k8s v1.1.1)
Waiting functionality for K8s.Client.
Note: This is built using repeated GET operations rather than using a watch operation w/ fieldSelector.
Link to this section Summary
Functions
Continually perform a GET based operation until a condition is met.
Link to this section Types
Specs
t() :: %K8s.Client.Runner.Wait{
eval: any() | (any() -> any()),
find: [binary()] | (any() -> any()),
processor: (map(), map() -> {:ok, map()} | {:error, K8s.Operation.Error.t()}),
sleep: pos_integer(),
timeout: pos_integer(),
timeout_after: NaiveDateTime.t()
}
A wait configuration
Link to this section Functions
Specs
run(K8s.Conn.t(), K8s.Operation.t(), keyword()) :: {:ok, map()} | {:error, :timeout | K8s.Operation.Error.t()}
Continually perform a GET based operation until a condition is met.
example
Example
This follow example will wait 60 seconds for the field status.succeeded to equal 1.
op = K8s.Client.get("batch/v1", :job, namespace: "default", name: "sleep")
opts = [find: ["status", "succeeded"], eval: 1, timeout: 60]
{:ok, conn} = K8s.Conn.from_file("test/support/kube-config.yaml")
resp = K8s.Client.Runner.Wait.run(conn, op, opts)