meta

package
v0.0.4-0...-de66a47 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAnnotations

func AddAnnotations(o metav1.Object, annotations map[string]string)

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

func AddFinalizer(o metav1.Object, finalizer string)

AddFinalizer to the supplied k8s object's metadata.

func AddLabels

func AddLabels(o metav1.Object, labels map[string]string)

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 AsController

AsController converts the supplied object reference to a controller reference. You may also consider using metav1.NewControllerRef.

func AsOwner

AsOwner converts the supplied object reference to an owner reference.

func FinalizerExists

func FinalizerExists(o metav1.Object, finalizer string) bool

FinalizerExists checks whether a certain finalizer is already set on the aupplied object

func GVKToString

func GVKToString(gvk schema.GroupVersionKind) string

func GetGVKFromAPIVersionKind

func GetGVKFromAPIVersionKind(apiVersion, kind string) schema.GroupVersionKind

func GetGVKFromObject

func GetGVKFromObject(o client.Object) schema.GroupVersionKind

func GetResourcePbGVKFromSchemaGVK

func GetResourcePbGVKFromSchemaGVK(gvk schema.GroupVersionKind) resourcepb.GVK

func GetResourcePbGVKFromTypeNSN

func GetResourcePbGVKFromTypeNSN(nsn types.NamespacedName) *resourcepb.NSN

func GetSchemaGVKFromResourcePbGVK

func GetSchemaGVKFromResourcePbGVK(gvk *resourcepb.GVK) schema.GroupVersionKind

func GetTypeNSNFromResourcePbNSN

func GetTypeNSNFromResourcePbNSN(nsn *resourcepb.NSN) types.NamespacedName

func GetUnstructuredFromGVK

func GetUnstructuredFromGVK(gvk *schema.GroupVersionKind) *unstructured.Unstructured

func HaveSameController

func HaveSameController(a, b metav1.Object) bool

HaveSameController returns true if both supplied objects are controlled by the same object.

func Ignore

func Ignore(is ErrorIs, err error) error

func IgnoreNotFound

func IgnoreNotFound(err error) error

IgnoreNotFound returns the supplied error, or nil if the error indicates a Kubernetes resource was not found.

func MarshalData

func MarshalData(o *unstructured.Unstructured) (any, error)

func PointerResourcePBGVK

func PointerResourcePBGVK(gvk resourcepb.GVK) *resourcepb.GVK

func RemoveAnnotations

func RemoveAnnotations(o metav1.Object, annotations ...string)

func RemoveFinalizer

func RemoveFinalizer(o metav1.Object, finalizer string)

RemoveFinalizer from the supplied k8s object's metadata.

func RemoveLabels

func RemoveLabels(o metav1.Object, labels ...string)

func ResourcePbGVKTostring

func ResourcePbGVKTostring(gvk resourcepb.GVK) string

func ResourcePbNsnToString

func ResourcePbNsnToString(nsn *resourcepb.NSN) string

func StringToGVK

func StringToGVK(s string) schema.GroupVersionKind

func StringToGroupVersionKind

func StringToGroupVersionKind(s string) (string, string, string)

func StringToResourcePbGVK

func StringToResourcePbGVK(s string) resourcepb.GVK

func StringToResourcePbNsn

func StringToResourcePbNsn(s string) *resourcepb.NSN

func WasDeleted

func WasDeleted(o metav1.Object) bool

Types

type APIFinalizer

type APIFinalizer struct {
	// contains filtered or unexported fields
}

An APIFinalizer manages the lifecycle of a finalizer on a k8s object.

func NewAPIFinalizer

func NewAPIFinalizer(c client.Client, finalizer string) *APIFinalizer

NewAPIFinalizer returns a new APIFinalizer.

func (*APIFinalizer) AddFinalizer

func (a *APIFinalizer) AddFinalizer(ctx context.Context, obj Object) error

AddFinalizer to the supplied Managed resource.

func (*APIFinalizer) RemoveFinalizer

func (a *APIFinalizer) RemoveFinalizer(ctx context.Context, obj Object) error

type APIUpdatingApplicator

type APIUpdatingApplicator struct {
	// contains filtered or unexported fields
}

An APIUpdatingApplicator applies changes to an object by either creating or updating it in a Kubernetes API server.

func NewAPIUpdatingApplicator

func NewAPIUpdatingApplicator(c client.Client) *APIUpdatingApplicator

NewAPIUpdatingApplicator returns an Applicator that applies changes to an object by either creating or updating it in a Kubernetes API server.

func (*APIUpdatingApplicator) Apply

Apply changes to the supplied object. The object will be created if it does not exist, or updated if it does.

type ApplyOption

type ApplyOption func(ctx context.Context, current, desired runtime.Object) error

An ApplyOption is called before patching the current object to match the desired object. ApplyOptions are not called if no current object exists.

type ErrorIs

type ErrorIs func(err error) bool

type Finalizer

type Finalizer interface {
	AddFinalizer(ctx context.Context, obj Object) error
	RemoveFinalizer(ctx context.Context, obj Object) error
}

Finalizer manages the lifecycle of the finalizer on a k8s object

type Object

type Object interface {
	metav1.Object
	runtime.Object
}

type OwnerRef

type OwnerRef struct {
	APIVersion string    `json:"apiVersion" yaml:"apiVersion"`
	Kind       string    `json:"kind" yaml:"kind"`
	Namespace  string    `json:"namespace" yaml:"namespace"`
	Name       string    `json:"name" yaml:"name"`
	UID        types.UID `json:"uid" yaml:"uid"`
}

func (*OwnerRef) String

func (r *OwnerRef) String() string

Jump to

Keyboard shortcuts

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