k8s v0.5.2 K8s.Discovery.Driver.File

File Driver for Kubernetes API discovery.

This module allows API versions and Resources accessible by the k8s to be defined rather than discovered.

This module is primarily used for testing, but can be used if you wish to hard code supported API versions and resources.

See ./test/support/discovery/example.json for an example.

Examples

"Discovering" hard coded resources.

iex> K8s.Discovery.Driver.File.resources("apps/v1", %K8s.Conn{}, config: "./test/support/discovery/example.json")
[
  %{
    "kind" => "DaemonSet",
    "name" => "daemonsets"
  },
  %{
    "kind" => "Deployment",
    "name" => "deployments"
  },
  %{
    "kind" => "Deployment",
    "name" => "deployments/status"
  }
]

"Discovering" hard coded versions.

iex> K8s.Discovery.Driver.File.versions(%K8s.Conn{}, config: "./test/support/discovery/example.json")
["v1", "apps/v1"]