Documentation ¶
Overview ¶
Package kubernetes implements helper functions for manipulating resources in a Kubernetes cluster.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Context for executing kubernetes operations Context context.Context // Path to Kubernetes access configuration Kubeconfig string }
Config defines the configuration for creating a Kubernetes instance
type FakeKubernetes ¶
FakeKubernetes is a fake implementation of the Kubernetes interface
func NewFakeKubernetes ¶
func NewFakeKubernetes(clientset *fake.Clientset) (*FakeKubernetes, error)
NewFakeKubernetes returns a new fake implementation of Kubernetes from fake Clientset
func (*FakeKubernetes) Context ¶
func (f *FakeKubernetes) Context() context.Context
Context returns the context for executing k8s actions
func (*FakeKubernetes) GetFakeProcessExecutor ¶
func (f *FakeKubernetes) GetFakeProcessExecutor() *helpers.FakePodCommandExecutor
GetFakeProcessExecutor returns the FakeProcessExecutor used by the helpers to mock the execution of commands in a Pod
func (*FakeKubernetes) Helpers ¶
func (f *FakeKubernetes) Helpers() helpers.Helpers
Helpers return a instance of FakeHelper
func (*FakeKubernetes) NamespacedHelpers ¶
func (f *FakeKubernetes) NamespacedHelpers(namespace string) helpers.Helpers
NamespacedHelpers return a instance of FakeHelper for a given namespace
type Kubernetes ¶
type Kubernetes interface { kubernetes.Interface Context() context.Context Helpers() helpers.Helpers NamespacedHelpers(namespace string) helpers.Helpers }
Kubernetes defines an interface that extends kubernetes interface[k8s.io/client-go/kubernetes.Interface] Adding helper functions for common tasks
func NewFromConfig ¶
func NewFromConfig(c Config) (Kubernetes, error)
NewFromConfig returns a Kubernetes instance configured with the given options
func NewFromKubeconfig ¶
func NewFromKubeconfig(kubeconfig string) (Kubernetes, error)
NewFromKubeconfig returns a Kubernetes instance configured with the kubeconfig pointed by the given path