K8s.Client.Runner.Watch (k8s v1.0.0-rc1) View Source
K8s.Client runner that will watch a resource or resources and stream results back to a process.
Link to this section Summary
Functions
Watch a resource or list of resources. Provide the stream_to option or results will be stream to self().
Watch a resource or list of resources from a specific resource version. Provide the stream_to option or results will be stream to self().
Link to this section Functions
Specs
run(K8s.Conn.t(), K8s.Operation.t(), keyword(atom())) :: K8s.Client.Runner.Base.result_t()
Watch a resource or list of resources. Provide the stream_to option or results will be stream to self().
Note: Current resource version will be looked up automatically.
Examples
{:ok, conn} = K8s.Conn.from_file("test/support/kube-config.yaml")
operation = K8s.Client.list("v1", "Namespace")
{:ok, reference} = Watch.run(conn, operation, stream_to: self()){:ok, conn} = K8s.Conn.from_file("test/support/kube-config.yaml")
operation = K8s.Client.get("v1", "Namespace", [name: "test"])
{:ok, reference} = Watch.run(conn, operation, stream_to: self())
Specs
run(K8s.Conn.t(), K8s.Operation.t(), binary(), keyword(atom())) :: K8s.Client.Runner.Base.result_t()
Watch a resource or list of resources from a specific resource version. Provide the stream_to option or results will be stream to self().
Examples
{:ok, conn} = K8s.Conn.from_file("test/support/kube-config.yaml")
operation = K8s.Client.list("v1", "Namespace")
resource_version = 3003
{:ok, reference} = Watch.run(conn, operation, resource_version, stream_to: self()){:ok, conn} = K8s.Conn.from_file("test/support/kube-config.yaml")
operation = K8s.Client.get("v1", "Namespace", [name: "test"])
resource_version = 3003
{:ok, reference} = Watch.run(conn, operation, resource_version, stream_to: self())