Documentation
¶
Index ¶
Constants ¶
View Source
const NamespaceEnv = "NAMESPACE"
NamespaceEnv is the environment variable for setting the k8s namespace
Variables ¶
This section is empty.
Functions ¶
func GetClientset ¶
func GetClientset() (*kubernetes.Clientset, error)
GetClientset returns a Kubernetes clientset
func GetRestConfig ¶
GetRestConfig returns the Kubernetes REST API configuration
Types ¶
type API ¶
type API interface {
// Namespace returns the Kubernetes namespace
Namespace() string
// Config returns the Kubernetes REST configuration
Config() *rest.Config
// Client returns the Kubernetes controller runtime client
Client() client.Client
// Clientset returns the Kubernetes Go clientset
Clientset() *kubernetes.Clientset
}
API exposes the Kubernetes API to tests
func GetAPIFromEnv ¶
GetAPIFromEnv returns the Kubernetes API for the current environment
func GetAPIFromEnvOrDie ¶
func GetAPIFromEnvOrDie() API
GetAPIFromEnvOrDie returns the Kubernetes API for the current environment and panics if no API could be found
func GetAPIOrDie ¶
GetAPIOrDie returns the Kubernetes API for the given namespace and panics if no configuration is found
type APIProvider ¶
type APIProvider interface {
// API returns the API
API() API
}
APIProvider is an interface for types to provide the Kubernetes API
Click to show internal directories.
Click to hide internal directories.