Documentation ¶
Index ¶
- Variables
- func EnsureOwnerRef(ownerReferences []metav1.OwnerReference, ref metav1.OwnerReference) []metav1.OwnerReference
- func GetClusterByName(ctx context.Context, c client.Client, namespace, name string) (*clusterv1.Cluster, error)
- func GetOwnerCluster(ctx context.Context, c client.Client, obj metav1.ObjectMeta) (*clusterv1.Cluster, error)
- func UnstructuredUnmarshalField(obj *unstructured.Unstructured, v interface{}, fields ...string) error
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.
Click to show internal directories.
Click to hide internal directories.