client

package
v0.0.0-...-8ffad75 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotControlled = errors.New("not controlled")

ErrNotControlled is returned if the actual object is not controlled by the specified owner.

Functions

func ByObjectCreationTimestamp

func ByObjectCreationTimestamp[OP Object[O], O any](obj1, obj2 O) bool

func ControlledCreateOrGet

func ControlledCreateOrGet(ctx context.Context, c client.Client, owner client.Object, obj client.Object, mutate controllerutil.MutateFn) error

ControlledCreateOrGet gets an object if it is controlled by the owner or creates the object with the given owner. If the object exists but is not owned, an error is returned.

func ForEachObjectInObjectStructSlice

func ForEachObjectInObjectStructSlice[O Object[OStruct], S ~[]OStruct, OStruct any](s S, f func(O))

func IterateObjectsInObjectStructSlice

func IterateObjectsInObjectStructSlice[O Object[OStruct], S ~[]OStruct, OStruct any](s S, yield func(O) bool) bool

func ObjectSliceOldestObjectIndex

func ObjectSliceOldestObjectIndex[S ~[]O, OP Object[O], O any](objs []O) int

func ObjectStructSliceToObjectByUIDMap

func ObjectStructSliceToObjectByUIDMap[O Object[OStruct], S ~[]OStruct, OStruct any](s S) map[types.UID]O

func PatchAddReconcileAnnotation

func PatchAddReconcileAnnotation(ctx context.Context, c client.Client, obj client.Object) error

func PatchEnsureNoReconcileAnnotation

func PatchEnsureNoReconcileAnnotation(ctx context.Context, c client.Client, obj client.Object) (modified bool, err error)

func PatchRemoveReconcileAnnotation

func PatchRemoveReconcileAnnotation(ctx context.Context, c client.Client, obj client.Object) error

func ReconcileRequestsFromObjectStructSlice

func ReconcileRequestsFromObjectStructSlice[O Object[OStruct], S ~[]OStruct, OStruct any](objs S) []reconcile.Request

Types

type CachingReader

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

func NewCachingReader

func NewCachingReader(reader client.Reader, cache *ReaderCache) *CachingReader

func (*CachingReader) Get

func (*CachingReader) List

func (r *CachingReader) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error

type CachingReaderBuilder

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

func NewCachingReaderBuilder

func NewCachingReaderBuilder(c client.Client) *CachingReaderBuilder

func (*CachingReaderBuilder) AddToCache

func (b *CachingReaderBuilder) AddToCache(ctx context.Context, cache *ReaderCache) error

func (*CachingReaderBuilder) Build

func (*CachingReaderBuilder) BuildCache

func (b *CachingReaderBuilder) BuildCache(ctx context.Context) (*ReaderCache, error)

func (*CachingReaderBuilder) Get

func (*CachingReaderBuilder) Insert

func (*CachingReaderBuilder) InsertList

func (*CachingReaderBuilder) List

type Object

type Object[O any] interface {
	client.Object
	*O
}

type ReaderCache

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

func NewReaderCache

func NewReaderCache(scheme *runtime.Scheme) *ReaderCache

func (*ReaderCache) CanList

func (c *ReaderCache) CanList(list client.ObjectList) (bool, error)

func (*ReaderCache) Get

func (*ReaderCache) Insert

func (c *ReaderCache) Insert(obj client.Object) error

func (*ReaderCache) InsertList

func (c *ReaderCache) InsertList(list client.ObjectList) error

func (*ReaderCache) List

func (c *ReaderCache) List(_ context.Context, list client.ObjectList, opts ...client.ListOption) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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