subresources

package
v0.0.0-...-a35f75d Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeResourceSlices

func MergeResourceSlices[T client.Object](slice1, slice2 []T) []T

MergeResourceSlices combines two slices of Kubernetes resources, deduplicating by name and namespace. When duplicates are found, the resource with the higher Generation is preserved as it represents the more recent version. This is useful when fetching resources with different label sets (e.g., legacy and new owner labels).

Types

type IRepository

type IRepository[T client.Object] interface {
	GetAll(ctx context.Context, labeler processing.Labeler) ([]T, error)
	// DeleteAll deletes all AccessRule resources that match either legacy owner labels or new owner labels
	DeleteAll(ctx context.Context, labeler processing.Labeler) error
}

type Repository

type Repository[T client.Object] struct {
	// contains filtered or unexported fields
}

func NewRepository

func NewRepository[T client.Object](c client.Client, grv schema.GroupVersionKind) *Repository[T]

func (*Repository[T]) DeleteAll

func (r *Repository[T]) DeleteAll(ctx context.Context, labeler processing.Labeler) error

DeleteAll retrieves and deletes all AccessRule resources with both legacy and new owner labels

func (*Repository[T]) GetAll

func (r *Repository[T]) GetAll(ctx context.Context, labeler processing.Labeler) ([]T, error)

GetAll retrieves all AccessRule resources with both legacy and new owner labels, combining them into a single deduplicated list

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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