k8sclient

package
v1.122.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetBuilder

func SetBuilder(builder K8sClientsetBuilder)

Types

type Builder

type Builder struct{}

Builder is the default implementation of K8sClientsetBuilder. It returns a regular k8s clientset.

func (*Builder) GetClientset

func (b *Builder) GetClientset(cfg *rest.Config) (kubernetes.Interface, error)

GetClientset returns a regular k8s client.

type K8sClientsetBuilder

type K8sClientsetBuilder interface {
	GetClientset(*rest.Config) (kubernetes.Interface, error)
}

K8sClientsetBuilder interface is used as an abstraction to get a k8s clientset. Useful to mock the client in tests.

func GetBuilder

func GetBuilder() K8sClientsetBuilder

type MockBuilder

type MockBuilder struct {
	Client kubernetes.Interface
	Err    error
}

func (*MockBuilder) GetClientset

func (b *MockBuilder) GetClientset(cfg *rest.Config) (kubernetes.Interface, error)

GetClientset returns the client that was set in the struct.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL