View Source K8s.Discovery.ResourceFinder (k8s v1.1.1)

Kubernetes API Groups

Link to this section Summary

Functions

Finds a resource definition by api version and (name or kind).

Get the REST resource name for a kubernetes Kind.

Link to this section Types

Specs

error_t() :: {:error, K8s.Discovery.Error.t()}

Link to this section Functions

Link to this function

find_resource(conn, api_version, name_or_kind)

View Source

Specs

find_resource(K8s.Conn.t(), binary(), atom() | binary()) ::
  {:ok, map()} | error_t()

Finds a resource definition by api version and (name or kind).

Link to this function

resource_name_for_kind(conn, api_version, name_or_kind)

View Source

Specs

resource_name_for_kind(K8s.Conn.t(), binary(), binary()) ::
  {:ok, binary()} | error_t()

Get the REST resource name for a kubernetes Kind.

Since K8s.Operation is abstracted away from a specific cluster, when working with kubernetes resource Maps and specifying "kind" the K8s.Operation.Path module isn't able to determine the correct path. (It will generate things like /api/v1/Pod instead of api/v1/pods).

Also accepts REST resource name in the event they are provided, as it may be known in the event of subresources.