unstructured

package
v1.16.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Overview

Package unstructured contains utilities unstructured Kubernetes objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListWrapper

type ListWrapper interface {
	GetUnstructuredList() *unstructured.UnstructuredList
}

ListWrapper allows the *unstructured.UnstructuredList to be accessed.

type Wrapper

type Wrapper interface {
	GetUnstructured() *unstructured.Unstructured
}

Wrapper returns the underlying *unstructured.Unstructured.

type WrapperClient

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

A WrapperClient is a client.Client that will operate on the underlying *unstructured.Unstructured if the object satisfies the Wrapper or ListWrapper interfaces.

func NewClient

func NewClient(c client.Client) *WrapperClient

NewClient returns a client.Client that will operate on the underlying *unstructured.Unstructured if the object satisfies the Wrapper or ListWrapper interfaces. It relies on *unstructured.Unstructured instead of simpler map[string]any to avoid unnecessary copying.

func (*WrapperClient) Create

func (c *WrapperClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error

Create saves the object obj in the Kubernetes cluster.

func (*WrapperClient) Delete

func (c *WrapperClient) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error

Delete deletes the given obj from Kubernetes cluster.

func (*WrapperClient) DeleteAllOf

func (c *WrapperClient) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error

DeleteAllOf deletes all objects of the given type matching the given options.

func (*WrapperClient) Get

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.

func (*WrapperClient) GroupVersionKindFor added in v0.20.0

func (c *WrapperClient) GroupVersionKindFor(obj runtime.Object) (schema.GroupVersionKind, error)

GroupVersionKindFor returns the GVK for the given obj.

func (*WrapperClient) IsObjectNamespaced added in v0.20.0

func (c *WrapperClient) IsObjectNamespaced(obj runtime.Object) (bool, error)

IsObjectNamespaced checks whether the object is namespaced.

func (*WrapperClient) List

func (c *WrapperClient) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) 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.

func (*WrapperClient) Patch

func (c *WrapperClient) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) 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.

func (*WrapperClient) RESTMapper added in v0.13.0

func (c *WrapperClient) RESTMapper() meta.RESTMapper

RESTMapper returns the rest this client is using.

func (*WrapperClient) Scheme added in v0.13.0

func (c *WrapperClient) Scheme() *runtime.Scheme

Scheme returns the scheme this client is using.

func (*WrapperClient) Status

func (c *WrapperClient) Status() client.StatusWriter

Status returns a client for the Status subresource.

func (*WrapperClient) SubResource added in v0.19.0

func (c *WrapperClient) SubResource(subResource string) client.SubResourceClient

SubResource returns the underlying client's SubResource client, unwrapped.

func (*WrapperClient) Update

func (c *WrapperClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) 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.

Directories

Path Synopsis
Package claim contains an unstructured composite resource claim.
Package claim contains an unstructured composite resource claim.
Package composed contains an unstructured composed resource.
Package composed contains an unstructured composed resource.
Package composite contains an unstructured composite resource.
Package composite contains an unstructured composite resource.

Jump to

Keyboard shortcuts

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