kubeclient

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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct{}

Builder is the default implementation of KubeClientBuilder. It returns a regular kube client.

func (*Builder) GetKubeClient

func (b *Builder) GetKubeClient(ctx context.Context) (kbclient.Client, error)

GetKubeClient returns a regular kube client.

type KubeClientBuilder

type KubeClientBuilder interface {
	GetKubeClient(ctx context.Context) (kbclient.Client, error)
}

KubeClientBuilder interface is used as an abstraction to get a kube client. Useful to mock the client in tests.

type MockBuilder

type MockBuilder struct {
	Client kbclient.Client
}

MockBuilder is a mock implementation of KubeClientBuilder. It returns the client that was set in the struct allowing you to set a fakeClient for example.

func (*MockBuilder) GetKubeClient

func (b *MockBuilder) GetKubeClient(ctx context.Context) (kbclient.Client, error)

GetKubeClient 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