unstructured

package
v1.105.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrPatchObject

func CreateOrPatchObject(ctx context.Context, c client.Client, gvk schema.GroupVersionKind, name, namespace string, content map[string]any) error

CreateOrPatchObject creates or patches the object with the given GVK, name, and namespace using the given client. The object is created or patched with the given content, except for system metadata fields, namespace, and name. This function can be combined with runtime.DefaultUnstructuredConverter.ToUnstructured to create or update an object from runtime.RawExtension.

func CreateOrPatchObjectByRef

func CreateOrPatchObjectByRef(ctx context.Context, c client.Client, ref *autoscalingv1.CrossVersionObjectReference, namespace string, content map[string]any) error

CreateOrPatchObjectByRef creates or patches the object with the given reference and namespace using the given client. The object is created or patched with the given content, except for system metadata fields. This function can be combined with runtime.DefaultUnstructuredConverter.ToUnstructured to create or update an object from runtime.RawExtension.

func DeleteObject

func DeleteObject(ctx context.Context, c client.Client, gvk schema.GroupVersionKind, name, namespace string) error

DeleteObject deletes the object with the given GVK, name, and namespace using the given client.

func DeleteObjectByRef

func DeleteObjectByRef(ctx context.Context, c client.Client, ref *autoscalingv1.CrossVersionObjectReference, namespace string) error

DeleteObjectByRef deletes the object with the given reference and namespace using the given client.

func FilterMetadata added in v1.40.3

func FilterMetadata(content map[string]any, fields ...string) map[string]any

FilterMetadata filters metadata from the provided unstructured object content.

func GetObject

func GetObject(ctx context.Context, c client.Client, gvk schema.GroupVersionKind, name, namespace string) (map[string]any, error)

GetObject returns the object with the given GVK, name, and namespace as a map using the given client. The full content of the object is returned as map[string]any, except for system metadata fields. This function can be combined with runtime.DefaultUnstructuredConverter.FromUnstructured to get the object content as runtime.RawExtension.

func GetObjectByRef

func GetObjectByRef(ctx context.Context, c client.Client, ref *autoscalingv1.CrossVersionObjectReference, namespace string) (map[string]any, error)

GetObjectByRef returns the object with the given reference and namespace using the given client. The full content of the object is returned as map[string]any, except for system metadata fields. This function can be combined with runtime.DefaultUnstructuredConverter.FromUnstructured to get the object content as runtime.RawExtension.

Types

This section is empty.

Jump to

Keyboard shortcuts

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