Documentation ¶
Overview ¶
Package meta contains functions for dealing with Kubernetes object metadata.
Index ¶
- Constants
- func AddAnnotations(o metav1.Object, annotations map[string]string)
- func AddControllerReference(o metav1.Object, r metav1.OwnerReference) error
- func AddFinalizer(o metav1.Object, finalizer string)
- func AddLabels(o metav1.Object, labels map[string]string)
- func AddOwnerReference(o metav1.Object, r metav1.OwnerReference)
- func AllowPropagation(from, to metav1.Object)
- func AllowsPropagationFrom(to metav1.Object) types.NamespacedName
- func AllowsPropagationTo(from metav1.Object) map[types.NamespacedName]bool
- func AnnotationKeyPropagateTo(o metav1.Object) string
- func AsController(r *v1alpha1.TypedReference) metav1.OwnerReference
- func AsOwner(r *v1alpha1.TypedReference) metav1.OwnerReference
- func FinalizerExists(o metav1.Object, finalizer string) bool
- func GetExternalName(o metav1.Object) string
- func HaveSameController(a, b metav1.Object) bool
- func NamespacedNameOf(r *corev1.ObjectReference) types.NamespacedName
- func ReferenceTo(o metav1.Object, of schema.GroupVersionKind) *corev1.ObjectReference
- func RemoveAnnotations(o metav1.Object, annotations ...string)
- func RemoveFinalizer(o metav1.Object, finalizer string)
- func RemoveLabels(o metav1.Object, labels ...string)
- func SetExternalName(o metav1.Object, name string)
- func TypedReferenceTo(o metav1.Object, of schema.GroupVersionKind) *v1alpha1.TypedReference
- func WasCreated(o metav1.Object) bool
- func WasDeleted(o metav1.Object) bool
Constants ¶
const ( AnnotationKeyPropagateToPrefix = "to.propagate.crossplane.io/" AnnotationKeyPropagateFromNamespace = "from.propagate.crossplane.io/namespace" AnnotationKeyPropagateFromName = "from.propagate.crossplane.io/name" )
Supported resources with all of these annotations will be fully or partially propagated to the named resource of the same kind, assuming it exists and consents to propagation.
const AnnotationKeyExternalName = "crossplane.io/external-name"
AnnotationKeyExternalName is the key in the annotations map of a resource for the name of the resource as it appears on provider's systems.
Variables ¶
This section is empty.
Functions ¶
func AddAnnotations ¶
AddAnnotations to the supplied object.
func AddControllerReference ¶
func AddControllerReference(o metav1.Object, r metav1.OwnerReference) error
AddControllerReference to the supplied object's metadata. Any existing owner with the same UID as the supplied reference will be replaced. Returns an error if the supplied object is already controlled by a different owner.
func AddFinalizer ¶
AddFinalizer to the supplied Kubernetes object's metadata.
func AddOwnerReference ¶
func AddOwnerReference(o metav1.Object, r metav1.OwnerReference)
AddOwnerReference to the supplied object' metadata. Any existing owner with the same UID as the supplied reference will be replaced.
func AllowPropagation ¶ added in v0.7.0
AllowPropagation from one object to another by adding consenting annotations to both.
func AllowsPropagationFrom ¶ added in v0.7.0
func AllowsPropagationFrom(to metav1.Object) types.NamespacedName
AllowsPropagationFrom returns the NamespacedName of the object the supplied object should be propagated from.
func AllowsPropagationTo ¶ added in v0.7.0
func AllowsPropagationTo(from metav1.Object) map[types.NamespacedName]bool
AllowsPropagationTo returns the set of NamespacedNames that the supplied object may be propagated to.
func AnnotationKeyPropagateTo ¶ added in v0.7.0
AnnotationKeyPropagateTo returns an annotation key whose presence indicates that the annotated object consents to propagation from the supplied object. The annotation name (which follows the prefix) can be anything that doesn't collide with another annotation. to.propagation.crossplane.io/example would be valid. This function uses a hash of the supplied object's namespace and name in order to avoid collisions and keep the suffix relatively short.
func AsController ¶
func AsController(r *v1alpha1.TypedReference) metav1.OwnerReference
AsController converts the supplied object reference to a controller reference. You may also consider using metav1.NewControllerRef.
func AsOwner ¶
func AsOwner(r *v1alpha1.TypedReference) metav1.OwnerReference
AsOwner converts the supplied object reference to an owner reference.
func FinalizerExists ¶
FinalizerExists checks whether given finalizer is already set.
func GetExternalName ¶
GetExternalName returns the external name annotation value on the resource.
func HaveSameController ¶
HaveSameController returns true if both supplied objects are controlled by the same object.
func NamespacedNameOf ¶
func NamespacedNameOf(r *corev1.ObjectReference) types.NamespacedName
NamespacedNameOf returns the referenced object's namespaced name.
func ReferenceTo ¶
func ReferenceTo(o metav1.Object, of schema.GroupVersionKind) *corev1.ObjectReference
ReferenceTo returns an object reference to the supplied object, presumed to be of the supplied group, version, and kind. Deprecated: use a more specific reference type, such as TypedReference or Reference instead of the overly verbose ObjectReference. See https://github.com/crossplane/crossplane-runtime/issues/49
func RemoveAnnotations ¶
RemoveAnnotations with the supplied keys from the supplied object.
func RemoveFinalizer ¶
RemoveFinalizer from the supplied Kubernetes object's metadata.
func RemoveLabels ¶
RemoveLabels with the supplied keys from the supplied object.
func SetExternalName ¶
SetExternalName sets the external name annotation of the resource.
func TypedReferenceTo ¶ added in v0.10.0
func TypedReferenceTo(o metav1.Object, of schema.GroupVersionKind) *v1alpha1.TypedReference
TypedReferenceTo returns a typed object reference to the supplied object, presumed to be of the supplied group, version, and kind.
func WasCreated ¶
WasCreated returns true if the supplied object was created in the API server.
func WasDeleted ¶
WasDeleted returns true if the supplied object was deleted from the API server.
Types ¶
This section is empty.