View Source K8s.Discovery.Driver behaviour (k8s v1.1.1)
Driver behaviour for K8s.Discovery
Link to this section Summary
Types
Errors returned by adapters should return an error tuple with an atom()
describing the error or alternatively an "error" struct with more details.
Link to this section Types
Specs
Errors returned by adapters should return an error tuple with an atom()
describing the error or alternatively an "error" struct with more details.
examples
Examples
{:error, :file_not_found}
{:error, %K8s.Discovery.Driver.MyDriver.FileNotFoundError{config: "path-to-file"}}
Link to this section Callbacks
Specs
resources(api_version :: String.t(), conn :: K8s.Conn.t()) :: {:ok, [map()]} | driver_error_t()
List of Kubernetes APIResourceList
s
examples
Examples
iex> {:ok, conn} = K8s.Conn.from_file("test/support/kube-config.yaml")
...> K8s.Discovery.Driver.HTTP.resources("autoscaling/v1", conn)
{:ok, [
%{
"kind" => "DaemonSet",
"name" => "daemonsets"
},
%{
"kind" => "Deployment",
"name" => "deployments"
},
%{
"kind" => "Deployment",
"name" => "deployments/status"
}
]}
Specs
resources(api_version :: String.t(), conn :: K8s.Conn.t(), opts :: Keyword.t()) :: {:ok, [map()]} | driver_error_t()
Specs
versions(conn :: K8s.Conn.t()) :: {:ok, [String.t()]} | driver_error_t()
List of Kubernetes apiVersion
s
examples
Examples
iex> {:ok, conn} = K8s.Conn.from_file("test/support/kube-config.yaml")
...> K8s.Discovery.Driver.HTTP.api(conn)
{:ok, ["v1"]}
Specs
versions(conn :: K8s.Conn.t(), opts :: Keyword.t()) :: {:ok, [String.t()]} | driver_error_t()