utils

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateListForType

func CreateListForType[T any, P ObjectPointerType[T]](scheme *runtime.Scheme) client.ObjectList

func ExtractGroupName

func ExtractGroupName(apiVersion string) string

func GetGroupKindForObject

func GetGroupKindForObject(scheme *runtime.Scheme, obj client.Object) *schema.GroupKind

func GetGroupKindForType

func GetGroupKindForType[T any, P ObjectPointerType[T]](scheme *runtime.Scheme) *schema.GroupKind

func IsSameResource added in v0.1.1

func IsSameResource(a, b SourceRefProvider) bool

func KeyForReference

func KeyForReference(o metav1.Object, ref SourceRefProvider) string

func OwnerReferenceIndex

func OwnerReferenceIndex() func(o ctrlclient.Object) []string

Types

type DefaultSourceRef

type DefaultSourceRef struct {
	schema.GroupKind
	types.NamespacedName
}

func (*DefaultSourceRef) GetGroupKind

func (d *DefaultSourceRef) GetGroupKind() schema.GroupKind

func (*DefaultSourceRef) GetName

func (d *DefaultSourceRef) GetName() string

func (*DefaultSourceRef) GetNamespace

func (d *DefaultSourceRef) GetNamespace() string

func (*DefaultSourceRef) GetObjectKey

func (d *DefaultSourceRef) GetObjectKey() ctrlclient.ObjectKey

func (*DefaultSourceRef) String

func (d *DefaultSourceRef) String() string

type ObjectPointerType

type ObjectPointerType[T any] interface {
	*T
	client.Object
}

type SourceRefProvider

type SourceRefProvider interface {
	GetObjectKey() ctrlclient.ObjectKey
	GetGroupKind() schema.GroupKind
	GetName() string
	GetNamespace() string
	String() string
}

func NewSourceRef

func NewSourceRef(g, k, ns, name string) SourceRefProvider

func NormalizedSourceRef

func NormalizedSourceRef(ref SourceRefProvider, defns string) SourceRefProvider

Jump to

Keyboard shortcuts

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