Documentation
¶
Overview ¶
Package meta contains functions for dealing with Kubernetes object metadata.
Index ¶
- Constants
- func AddAnnotations(o metav1.Object, annotations map[string]string)
- func AddFinalizer(o metav1.Object, finalizer string)
- func AddLabels(o metav1.Object, labels map[string]string)
- func ExternalCreateIncomplete(o metav1.Object) bool
- func ExternalCreateSucceededDuring(o metav1.Object, d time.Duration) bool
- func FinalizerExists(o metav1.Object, finalizer string) bool
- func GetExternalCreateFailed(o metav1.Object) time.Time
- func GetExternalCreatePending(o metav1.Object) time.Time
- func GetExternalCreateSucceeded(o metav1.Object) time.Time
- func GetExternalName(o metav1.Object) string
- func IsActionAllowed(o metav1.Object, action string) bool
- func IsPaused(o metav1.Object) bool
- func IsVerbose(o metav1.Object) bool
- func RemoveAnnotations(o metav1.Object, annotations ...string)
- func RemoveFinalizer(o metav1.Object, finalizer string)
- func RemoveLabels(o metav1.Object, labels ...string)
- func SetExternalCreateFailed(o metav1.Object, t time.Time)
- func SetExternalCreatePending(o metav1.Object, t time.Time)
- func SetExternalCreateSucceeded(o metav1.Object, t time.Time)
- func SetExternalName(o metav1.Object, name string)
- func ShouldCreate(o metav1.Object) bool
- func ShouldDelete(o metav1.Object) bool
- func ShouldOnlyObserve(o metav1.Object) bool
- func ShouldUpdate(o metav1.Object) bool
- func WasCreated(o metav1.Object) bool
- func WasDeleted(o metav1.Object) bool
Constants ¶
const ( // AnnotationKeyExternalName is the key in the annotations map of a // resource for the name of the resource as it appears on provider's // systems. AnnotationKeyExternalName = "krateo.io/external-name" // AnnotationKeyExternalCreatePending is the key in the annotations map // of a resource that indicates the last time creation of the external // resource was pending (i.e. about to happen). Its value must be an // RFC3999 timestamp. AnnotationKeyExternalCreatePending = "krateo.io/external-create-pending" // AnnotationKeyExternalCreateSucceeded is the key in the annotations // map of a resource that represents the last time the external resource // was created successfully. Its value must be an RFC3339 timestamp, // which can be used to determine how long ago a resource was created. // This is useful for eventually consistent APIs that may take some time // before the API called by Observe will report that a recently created // external resource exists. AnnotationKeyExternalCreateSucceeded = "krateo.io/external-create-succeeded" // AnnotationKeyExternalCreateFailed is the key in the annotations map // of a resource that indicates the last time creation of the external // resource failed. Its value must be an RFC3999 timestamp. AnnotationKeyExternalCreateFailed = "krateo.io/external-create-failed" // AnnotationKeyReconciliationPaused is the key in the annotations map // of a resource that indicates that further reconciliations on the // resource are paused. All create/update/delete/generic events on // the resource will be filtered and thus no further reconcile requests // will be queued for the resource. AnnotationKeyReconciliationPaused = "krateo.io/paused" // AnnotationKeyConnectorVerbose is the key in the annotations map // of a resource that indicates that the external client has verbose info enabled. AnnotationKeyConnectorVerbose = "krateo.io/connector-verbose" // AnnotationKeyManagementPolicy is the key in the annotations map // of a resource to instruct the provider to manage resources in a fine-grained way. // default: The provider can fully manage the resource. // This is the default policy. // observe-create-update: The provider can observe, create, or update the // resource, but can not delete it. // observe-delete: The provider can observe or delete the resource, but // can not create and update it. // observe: The provider can only observe the resource. // This maps to the read-only scenario where the resource is fully controlled by third party application. AnnotationKeyManagementPolicy = "krateo.io/management-policy" // AnnotationKeyDeletionPolicy is the key in the annotations map // of a resource that determines what should happen to the underlying external // resource when a managed resource is deleted AnnotationKeyDeletionPolicy = "krateo.io/deletion-policy" )
const ( // ManagementPolicyDefault means the provider can fully manage the resource. ManagementPolicyDefault = "default" // ManagementPolicyObserveCreateUpdate means the provider can observe, create, // or update the resource, but can not delete it. ManagementPolicyObserveCreateUpdate = "observe-create-update" // ManagementPolicyObserveDelete means the provider can observe or delete // the resource, but can not create and update it. ManagementPolicyObserveDelete = "observe-delete" // ManagementPolicyObserve means the provider can only observe the resource. ManagementPolicyObserve = "observe" // DeletionPolicyOrphan means the external resource will orphaned when its managed // resource is deleted. DeletionPolicyOrphan = "orphan" // DeletionPolicyDelete means both the external resource will be deleted when its // managed resource is deleted. DeletionPolicyDelete = "delete" // ActionCreate means to create an Object ActionCreate = "create" // ActionUpdate means to update an Object ActionUpdate = "update" // ActionDelete means to delete an Object ActionDelete = "delete" )
Variables ¶
This section is empty.
Functions ¶
func AddAnnotations ¶
AddAnnotations to the supplied object.
func AddFinalizer ¶
AddFinalizer to the supplied Kubernetes object's metadata.
func ExternalCreateIncomplete ¶
ExternalCreateIncomplete returns true if creation of the external resource appears to be incomplete. We deem creation to be incomplete if the 'external create pending' annotation is the newest of all tracking annotations that are set (i.e. pending, succeeded, and failed).
func ExternalCreateSucceededDuring ¶
ExternalCreateSucceededDuring returns true if creation of the external resource that corresponds to the supplied managed resource succeeded within the supplied duration.
func FinalizerExists ¶
FinalizerExists checks whether given finalizer is already set.
func GetExternalCreateFailed ¶
GetExternalCreateFailed returns the time at which the external resource recently failed to create.
func GetExternalCreatePending ¶
GetExternalCreatePending returns the time at which the external resource was most recently pending creation.
func GetExternalCreateSucceeded ¶
GetExternalCreateSucceeded returns the time at which the external resource was most recently created.
func GetExternalName ¶
GetExternalName returns the external name annotation value on the resource.
func IsActionAllowed ¶
IsActionAllowed determines if action is allowed to be performed on Object
func IsPaused ¶
IsPaused returns true if the object has the AnnotationKeyReconciliationPaused annotation set to `true`.
func IsVerbose ¶
IsVerbose returns true if the object has the AnnotationKeyConnectorVerbose annotation set to `true`.
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 SetExternalCreateFailed ¶
SetExternalCreateFailed sets the time at which the external resource most recently failed to create.
func SetExternalCreatePending ¶
SetExternalCreatePending sets the time at which the external resource was most recently pending creation to the supplied time.
func SetExternalCreateSucceeded ¶
SetExternalCreateSucceeded sets the time at which the external resource was most recently created to the supplied time.
func SetExternalName ¶
SetExternalName sets the external name annotation of the resource.
func ShouldCreate ¶
ShouldCreate returns true if the Create action is allowed.
func ShouldDelete ¶
ShouldDelete determines if the external resource will orphaned
func ShouldOnlyObserve ¶
ShouldOnlyObserve returns true if the Observe action is allowed and all other actions are not allowed.
func ShouldUpdate ¶
ShouldUpdate returns true if the Update action is allowed.
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.