unstructured

package
v1.88.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more 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]interface{}) 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]interface{}) 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]interface{}, fields ...string) map[string]interface{}

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]interface{}, 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]interface{}, 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]interface{}, 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]interface{}, 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