util

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// IsPaused returns true if the Cluster is paused or the object has the `paused` annotation.
	// Deprecated: use util/annotations/IsPaused instead
	IsPaused = annotations.IsPaused

	// HasPausedAnnotation returns true if the object has the `paused` annotation.
	// Deprecated: use util/annotations/HasPausedAnnotation instead
	HasPausedAnnotation = annotations.HasPausedAnnotation
)
View Source
var (
	ErrUnstructuredFieldNotFound = fmt.Errorf("field not found")
)

Functions

func EnsureOwnerRef

func EnsureOwnerRef(ownerReferences []metav1.OwnerReference, ref metav1.OwnerReference) []metav1.OwnerReference

EnsureOwnerRef makes sure the slice contains the OwnerReference.

func GetClusterByName

func GetClusterByName(ctx context.Context, c client.Client, namespace, name string) (*clusterv1.Cluster, error)

GetClusterByName finds and return a Cluster object using the specified params.

func GetOwnerCluster

func GetOwnerCluster(ctx context.Context, c client.Client, obj metav1.ObjectMeta) (*clusterv1.Cluster, error)

GetOwnerCluster returns the Cluster object owning the current resource.

func UnstructuredUnmarshalField

func UnstructuredUnmarshalField(obj *unstructured.Unstructured, v interface{}, fields ...string) error

UnstructuredUnmarshalField is a wrapper around json and unstructured objects to decode and copy a specific field value into an object.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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