kmeta

package
v3.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewControllerRef

func NewControllerRef(obj OwnerRefable) *metav1.OwnerReference

NewControllerRef creates an OwnerReference pointing to the given controller.

func ObjectReference

func ObjectReference(obj Accessor) corev1.ObjectReference

ObjectReference returns an core/v1.ObjectReference for the given object

Types

type Accessor

type Accessor interface {
	metav1.Object

	// Interfaces for metav1.TypeMeta
	GroupVersionKind() schema.GroupVersionKind
	SetGroupVersionKind(gvk schema.GroupVersionKind)

	// Interfaces for runtime.Object
	GetObjectKind() schema.ObjectKind
	DeepCopyObject() runtime.Object
}

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

func DeletionHandlingAccessor(obj interface{}) (Accessor, error)

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.

Jump to

Keyboard shortcuts

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