Documentation ¶
Overview ¶
Package kubernetes contains utilities for interacting with kubernetes clusters and unit testing code that deals with clusters
Index ¶
- Constants
- func GetConfigAndServer(h func(http.ResponseWriter, *http.Request)) (func() (*rest.Config, error), *httptest.Server, error)
- func GetDynamicClient() (dynamic.Interface, error)
- func GetKubernetesClientServer(h func(http.ResponseWriter, *http.Request)) (func() (dynamic.Interface, error), *httptest.Server, error)
Constants ¶
View Source
const ( NamespacesURI = "/api/v1/namespaces" ConfigMapsURI = "/api/v1/namespaces/vmware-system-telemetry/configmaps" TelemetryNamespace = "vmware-system-telemetry" TelemetryNamespaceURI = "/api/v1/namespaces/vmware-system-telemetry" CeipConfigMapName = "vmware-telemetry-cluster-ceip" CeipConfigMapURI = "/api/v1/namespaces/vmware-system-telemetry/configmaps/vmware-telemetry-cluster-ceip" )
Variables ¶
This section is empty.
Functions ¶
func GetConfigAndServer ¶
func GetConfigAndServer(h func(http.ResponseWriter, *http.Request)) (func() (*rest.Config, error), *httptest.Server, error)
GetConfigAndServer creates an httptest.Server that allows k8s based code to be tested locally Returns a function to acquire a rest.Config, leaving k8s client creation up to the caller
func GetDynamicClient ¶
GetDynamicClient gets a dynamic client for the targeted cluster We expect a KUBECONFIG env var to be set for cluster targeting
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.