kubernetesclientprovider

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionKind

type ConnectionKind string

ConnectionKind is the kind of connection to use for accessing Kubernetes.

const (

	// Kind
	KindDefault ConnectionKind = "default"
	KindNone    ConnectionKind = "none"
)

type KubernetesClientProvider

type KubernetesClientProvider struct {
	// contains filtered or unexported fields
}

KubernetesClientProvider provides access to Kubernetes clients.

func FromConfig

func FromConfig(config *rest.Config) *KubernetesClientProvider

FromConfig creates a new Kubernetes client provider from the given config.

For testing, pass a nil config, and then use the Set* methods to set the clients.

func FromOptions

func FromOptions(options Options) (*KubernetesClientProvider, error)

FromOptions creates a new Kubernetes client provider from the given options.

func (*KubernetesClientProvider) ClientGoClient

func (k *KubernetesClientProvider) ClientGoClient() (kubernetes.Interface, error)

ClientGoClient returns a Kubernetes client-go client.

func (*KubernetesClientProvider) Config

func (k *KubernetesClientProvider) Config() *rest.Config

Config returns the Kubernetes client provider's config.

func (*KubernetesClientProvider) DiscoveryClient

DiscoveryClient returns a Kubernetes discovery client.

func (*KubernetesClientProvider) DynamicClient

func (k *KubernetesClientProvider) DynamicClient() (dynamic.Interface, error)

DynamicClient returns a Kubernetes dynamic client.

func (*KubernetesClientProvider) RuntimeClient

func (k *KubernetesClientProvider) RuntimeClient() (runtimeclient.Client, error)

RuntimeClient returns a Kubernetes controller runtime client.

func (*KubernetesClientProvider) SetClientGoClient

func (k *KubernetesClientProvider) SetClientGoClient(client kubernetes.Interface)

SetClientGoClient sets the Kubernetes client-go client. This is useful for testing.

func (*KubernetesClientProvider) SetDiscoveryClient

func (k *KubernetesClientProvider) SetDiscoveryClient(client discovery.DiscoveryInterface)

SetDiscoveryClient sets the Kubernetes discovery client. This is useful for testing.

func (*KubernetesClientProvider) SetDynamicClient

func (k *KubernetesClientProvider) SetDynamicClient(client dynamic.Interface)

SetDynamicClient sets the Kubernetes dynamic client. This is useful for testing.

func (*KubernetesClientProvider) SetRuntimeClient

func (k *KubernetesClientProvider) SetRuntimeClient(client runtimeclient.Client)

SetRuntimeClient sets the Kubernetes controller runtime client. This is useful for testing.

type Options

type Options struct {
	// Kind is the kind of connection to use.
	Kind ConnectionKind `yaml:"kind"`
}

Options holds the configuration options for the Kubernetes client provider.

Jump to

Keyboard shortcuts

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