Documentation
¶
Overview ¶
Package kmeta provides Knative utilities for operating on Kubernetes resources' ObjectMeta.
Index ¶
- func ChildName(parent, suffix string) string
- func MakeGenerationLabelSelector(om metav1.ObjectMetaAccessor) labels.Selector
- func MakeGenerationLabels(om metav1.ObjectMetaAccessor) labels.Set
- func MakeOldGenerationLabelSelector(om metav1.ObjectMetaAccessor) labels.Selector
- func MakeOldVersionLabelSelector(om metav1.ObjectMetaAccessor) labels.Selector
- func MakeVersionLabelSelector(om metav1.ObjectMetaAccessor) labels.Selector
- func MakeVersionLabels(om metav1.ObjectMetaAccessor) labels.Set
- func NewControllerRef(obj OwnerRefable) *metav1.OwnerReference
- type Accessor
- type OwnerRefable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChildName ¶
ChildName generates a name for the resource based upong the parent resource and suffix. If the concatenated name is longer than K8s permits the name is hashed and truncated to permit construction of the resource, but still keeps it unique.
func MakeGenerationLabelSelector ¶
func MakeGenerationLabelSelector(om metav1.ObjectMetaAccessor) labels.Selector
MakeGenerationLabelSelector constructs a selector for subresources instantiated at this version of the parent resource. This keys off of the labels populated by MakeGenerationLabels.
func MakeGenerationLabels ¶
func MakeGenerationLabels(om metav1.ObjectMetaAccessor) labels.Set
MakeGenerationLabels constructs a set of labels to apply to subresources instantiated at this version of the parent resource, so that we can efficiently select them.
func MakeOldGenerationLabelSelector ¶
func MakeOldGenerationLabelSelector(om metav1.ObjectMetaAccessor) labels.Selector
MakeOldGenerationLabelSelector constructs a selector for subresources instantiated at an older version of the parent resource. This keys off of the labels populated by MakeGenerationLabels.
func MakeOldVersionLabelSelector ¶
func MakeOldVersionLabelSelector(om metav1.ObjectMetaAccessor) labels.Selector
MakeOldVersionLabelSelector constructs a selector for subresources instantiated at an older version of the parent resource. This keys off of the labels populated by MakeVersionLabels.
func MakeVersionLabelSelector ¶
func MakeVersionLabelSelector(om metav1.ObjectMetaAccessor) labels.Selector
MakeVersionLabelSelector constructs a selector for subresources instantiated at this version of the parent resource. This keys off of the labels populated by MakeVersionLabels.
func MakeVersionLabels ¶
func MakeVersionLabels(om metav1.ObjectMetaAccessor) labels.Set
MakeVersionLabels constructs a set of labels to apply to subresources instantiated at this version of the parent resource, so that we can efficiently select them.
func NewControllerRef ¶
func NewControllerRef(obj OwnerRefable) *metav1.OwnerReference
NewControllerRef creates an OwnerReference pointing to the given controller.
Types ¶
type Accessor ¶
type Accessor interface {
// Interfaces for metav1.TypeMeta
GroupVersionKind() schema.GroupVersionKind
SetGroupVersionKind(gvk schema.GroupVersionKind)
// Interfaces for runtime.Object
GetObjectKind() schema.ObjectKind
DeepCopyObject() runtime.Object
// Interfaces for metav1.Object
GetNamespace() string
SetNamespace(namespace string)
GetName() string
SetName(name string)
GetGenerateName() string
SetGenerateName(name string)
GetUID() types.UID
SetUID(uid types.UID)
GetResourceVersion() string
SetResourceVersion(version string)
GetGeneration() int64
SetGeneration(generation int64)
GetSelfLink() string
SetSelfLink(selfLink string)
GetCreationTimestamp() metav1.Time
SetCreationTimestamp(timestamp metav1.Time)
GetDeletionTimestamp() *metav1.Time
SetDeletionTimestamp(timestamp *metav1.Time)
GetDeletionGracePeriodSeconds() *int64
SetDeletionGracePeriodSeconds(*int64)
GetLabels() map[string]string
SetLabels(labels map[string]string)
GetAnnotations() map[string]string
SetAnnotations(annotations map[string]string)
GetInitializers() *metav1.Initializers
SetInitializers(initializers *metav1.Initializers)
GetFinalizers() []string
SetFinalizers(finalizers []string)
GetOwnerReferences() []metav1.OwnerReference
SetOwnerReferences([]metav1.OwnerReference)
GetClusterName() string
SetClusterName(clusterName string)
}
Accessor is a collection of interfaces from metav1.TypeMeta, runtime.Object and metav1.Object that Kubernetes API types registered with runtime.Scheme must support.
func DeletionHandlingAccessor ¶
DeletionHandlingAccessor tries to convert given interface into Accessor first; and to handle deletion, it try to fetch info from DeletedFinalStateUnknown on failure. The name is a reference to cache.DeletionHandlingMetaNamespaceKeyFunc
type OwnerRefable ¶
type OwnerRefable interface {
metav1.ObjectMetaAccessor
// GetGroupVersionKind returns a GroupVersionKind. The name is chosen
// to avoid collision with TypeMeta's GroupVersionKind() method.
// See: https://issues.k8s.io/3030
GetGroupVersionKind() schema.GroupVersionKind
}
OwnerRefable indicates that a particular type has sufficient information to produce a metav1.OwnerReference to an object.