dynamic

package
v0.0.0-...-33deb92 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetClient(obj *unstructured.Unstructured) (ResourceClient, error)
}

Client returns a client from a given unstructured object. It can be used when creating an object from a yaml file.

func NewDynamicClient

func NewDynamicClient(kubeConfig *rest.Config) (Client, error)

type ResourceClient

type ResourceClient interface {
	Get(ctx context.Context, name string, options metav1.GetOptions) (*unstructured.Unstructured, error)
	Create(ctx context.Context, obj *unstructured.Unstructured, options metav1.CreateOptions) (*unstructured.Unstructured, error)
	Delete(ctx context.Context, name string, options metav1.DeleteOptions) error
}

ResourceClient is an interface that can be used for *K8sObjectWithRetry helper functions. In the original dynamic client, each method supports actions over subresources, which typed clients don't. Because of the difference, it needs to be wrapped with a new interface to be used in the helper functions. cf. https://pkg.go.dev/k8s.io/client-go/dynamic#ResourceInterface

Jump to

Keyboard shortcuts

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