kubeclient

package
v0.0.0-...-a142011 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClient

func GetClient[T, TL runtime.Object](c ClientGetter, namespace string) ktypes.ReadWriteAPI[T, TL]

func GetInformerFiltered

GetInformerFiltered attempts to use type information to setup the informer based on registered types. If no registered type is found, this will fallback to the same behavior as GetInformerFilteredFromGVR.

func GetInformerFilteredFromGVR

GetInformerFilteredFromGVR will build an informer for the given GVR. When using ktypes.StandardInformer as the InformerType, the clients are selected from a statically defined list. Use GetInformerFiltered[T] for dynamically registered types.

func GetWriteClient

func GetWriteClient[T runtime.Object](c ClientGetter, namespace string) ktypes.WriteAPI[T]

func Register

func Register[T runtime.Object](
	gvr schema.GroupVersionResource,
	gvk schema.GroupVersionKind,
	list func(c ClientGetter, namespace string, o metav1.ListOptions) (runtime.Object, error),
	watch func(c ClientGetter, namespace string, o metav1.ListOptions) (watch.Interface, error),
)

Register provides the TypeRegistration to the underlying store to enable dynamic object translation

Types

type ClientGetter

type ClientGetter interface {
	// Ext returns the API extensions client.
	Ext() kubeext.Interface

	// Kube returns the core kube client
	Kube() kubernetes.Interface

	// Dynamic client.
	Dynamic() dynamic.Interface

	// Metadata returns the Metadata kube client.
	Metadata() metadata.Interface

	// Istio returns the Istio kube client.
	Istio() istioclient.Interface

	// GatewayAPI returns the gateway-api kube client.
	GatewayAPI() gatewayapiclient.Interface

	// Informers returns an informer factory.
	Informers() informerfactory.InformerFactory
}

type TypeRegistration

type TypeRegistration[T runtime.Object] interface {
	kubetypes.RegisterType[T]

	// ListWatchFunc provides the necessary methods for list and
	// watch for the informer
	ListWatch(c ClientGetter, opts ktypes.InformerOptions) cache.ListerWatcher
}

TypeRegistration represents the necessary methods to provide a custom type to the kubeclient informer mechanism

Jump to

Keyboard shortcuts

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