Documentation ¶
Overview ¶
Package resource contains shared utility methods for resource management.
Index ¶
- func AddGlobalAnnotations(obj metav1.Object)
- func AddGlobalLabels(obj metav1.Object)
- func CreateOrUpdate(ctx context.Context, c client.Client, obj client.Object, mutateFn func() error) (controllerutil.OperationResult, error)
- func GetGlobalAnnotations() map[string]string
- func GetGlobalLabels() map[string]string
- func SetGlobalAnnotations(annotations map[string]string)
- func SetGlobalLabels(labels map[string]string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddGlobalAnnotations ¶
AddGlobalAnnotations adds the global annotations to the given object's annotations. If the object's annotations is nil, it will be initialized.
func AddGlobalLabels ¶
AddGlobalLabels adds the global labels to the given object's labels. If the object's labels is nil, it will be initialized.
func CreateOrUpdate ¶
func CreateOrUpdate(ctx context.Context, c client.Client, obj client.Object, mutateFn func() error) (controllerutil.OperationResult, error)
CreateOrUpdate is a wrapper around controllerutil.CreateOrUpdate that automatically adds global labels and annotations. It takes the same parameters as controllerutil.CreateOrUpdate plus an optional list of additional labels to merge.
func GetGlobalAnnotations ¶
GetGlobalAnnotations returns a copy of the current global annotations.
func GetGlobalLabels ¶
GetGlobalLabels returns a copy of the current global labels.
func SetGlobalAnnotations ¶
SetGlobalAnnotations sets the global annotations that should be added to all resources.
func SetGlobalLabels ¶
SetGlobalLabels sets the global labels that should be added to all resources.
Types ¶
This section is empty.