View Source K8s.Discovery.Driver.File (k8s v1.1.5)

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

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"]