client

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColouredName added in v0.0.2

func ColouredName(key ctrlclient.ObjectKey, color *color.Color) string

func Name

func Name(key ctrlclient.ObjectKey) string

func Namespace

func Namespace(name string) corev1.Namespace

func ObjectKey

func ObjectKey(obj metav1.Object) ctrlclient.ObjectKey

func PatchObject

func PatchObject(actual, expected runtime.Object) (runtime.Object, error)

func Pet

func Pet() string

func PetNamespace

func PetNamespace() corev1.Namespace

func ToUnstructured added in v0.0.7

func ToUnstructured(obj any) unstructured.Unstructured

Types

type Client

type Client interface {
	// Get retrieves an obj for the given object key from the Kubernetes Cluster.
	// obj must be a struct pointer so that obj can be updated with the response
	// returned by the Server.
	Get(ctx context.Context, key ctrlclient.ObjectKey, obj ctrlclient.Object, opts ...ctrlclient.GetOption) error

	// List retrieves list of objects for a given namespace and list options. On a
	// successful call, Items field in the list will be populated with the
	// result returned from the server.
	List(ctx context.Context, list ctrlclient.ObjectList, opts ...ctrlclient.ListOption) error

	// Create saves the object obj in the Kubernetes cluster. obj must be a
	// struct pointer so that obj can be updated with the content returned by the Server.
	Create(ctx context.Context, obj ctrlclient.Object, opts ...ctrlclient.CreateOption) error

	// Update updates the given obj in the Kubernetes cluster. obj must be a
	// struct pointer so that obj can be updated with the content returned by the Server.
	Update(ctx context.Context, obj ctrlclient.Object, opts ...ctrlclient.UpdateOption) error

	// Delete deletes the given obj from Kubernetes cluster.
	Delete(ctx context.Context, obj ctrlclient.Object, opts ...ctrlclient.DeleteOption) error

	// Patch patches the given obj in the Kubernetes cluster. obj must be a
	// struct pointer so that obj can be updated with the content returned by the Server.
	Patch(ctx context.Context, obj ctrlclient.Object, patch ctrlclient.Patch, opts ...ctrlclient.PatchOption) error

	// IsObjectNamespaced returns true if the GroupVersionKind of the object is namespaced.
	IsObjectNamespaced(obj runtime.Object) (bool, error)

	// RESTMapper returns the rest this client is using.
	RESTMapper() meta.RESTMapper
}

func DryRun added in v0.0.6

func DryRun(inner Client) Client

func New

func New(cfg *rest.Config) (Client, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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