crud

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateIfNotExistTemplatedResources

func CreateIfNotExistTemplatedResources(context context.Context, owner client.Object, namespace string, data interface{}, template *template.Template) error

CreateIfNotExistTemplatedResources processes an initialized template expecting an array of objects as a result and then processes them with the CreateResourceIfNotExists function requires a context with log and client

func CreateOrUpdateResource

func CreateOrUpdateResource(context context.Context, owner client.Object, namespace string, obj client.Object) error

CreateOrUpdateResource creates a resource if it doesn't exist, and updates (overwrites it), if it exist if owner is not nil, the owner field os set if namespace is not "", the namespace field of the object is overwritten with the passed value requires a context with log and client

func CreateOrUpdateResources

func CreateOrUpdateResources(context context.Context, owner client.Object, namespace string, objs []client.Object) error

CreateOrUpdateResources operates as CreateOrUpdate, but on an array of resources requires a context with log and client

func CreateOrUpdateTemplatedResources

func CreateOrUpdateTemplatedResources(context context.Context, owner client.Object, namespace string, data interface{}, template *template.Template) error

CreateOrUpdateTemplatedResources processes an initialized template expecting an array of objects as a result and the processes them with the CreateOrUpdate function requires a context with log and client

func CreateOrUpdateUnstructuredResources

func CreateOrUpdateUnstructuredResources(context context.Context, owner client.Object, namespace string, objs []unstructured.Unstructured) error

CreateOrUpdateUnstructuredResources operates as CreateOrUpdate, but on an array of unstructured.Unstructured requires a context with log and client

func CreateResourceIfNotExists

func CreateResourceIfNotExists(context context.Context, owner client.Object, namespace string, obj client.Object) error

CreateResourceIfNotExists create a resource if it doesn't already exists. If the resource exists it is left untouched and the functin does not fails if owner is not nil, the owner field os set if namespace is not "", the namespace field of the object is overwritten with the passed value requires a context with log and client

func CreateResourcesIfNotExist

func CreateResourcesIfNotExist(context context.Context, owner client.Object, namespace string, objs []client.Object) error

CreateResourcesIfNotExist operates as CreateResourceIfNotExists, but on an array of resources requires a context with log and client

func CreateUnstructuredResourcesIfNotExist

func CreateUnstructuredResourcesIfNotExist(context context.Context, owner client.Object, namespace string, objs []unstructured.Unstructured) error

CreateUnstructuredResourcesIfNotExist operates as CreateResourceIfNotExists, but on an array of unstructured.Unstructured requires a context with log and client

func DeleteResourceIfExists

func DeleteResourceIfExists(context context.Context, obj client.Object) error

DeleteResourceIfExists deletes an existing resource. It doesn't fail if the resource does not exist requires a context with log and client

func DeleteResourcesIfExist

func DeleteResourcesIfExist(context context.Context, objs []client.Object) error

DeleteResourcesIfExist operates like DeleteResources, but on an arrays of resources requires a context with log and client

func DeleteTemplatedResources

func DeleteTemplatedResources(context context.Context, data interface{}, template *template.Template) error

DeleteTemplatedResources processes an initialized template expecting an array of objects as a result and then processes them with the Delete function requires a context with log and client

func DeleteUnstructuredResources

func DeleteUnstructuredResources(context context.Context, objs []unstructured.Unstructured) error

DeleteUnstructuredResources operates like DeleteResources, but on an arrays of unstructured.Unstructured requires a context with log and client

Types

This section is empty.

Jump to

Keyboard shortcuts

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