Documentation ¶
Index ¶
- Variables
- func ByObjectCreationTimestamp[OP Object[O], O any](obj1, obj2 O) bool
- func ControlledCreateOrGet(ctx context.Context, c client.Client, owner client.Object, obj client.Object, ...) error
- func ForEachObjectInObjectStructSlice[O Object[OStruct], S ~[]OStruct, OStruct any](s S, f func(O))
- func IterateObjectsInObjectStructSlice[O Object[OStruct], S ~[]OStruct, OStruct any](s S, yield func(O) bool) bool
- func ObjectSliceOldestObjectIndex[S ~[]O, OP Object[O], O any](objs []O) int
- func ObjectStructSliceToObjectByUIDMap[O Object[OStruct], S ~[]OStruct, OStruct any](s S) map[types.UID]O
- func PatchAddReconcileAnnotation(ctx context.Context, c client.Client, obj client.Object) error
- func PatchEnsureNoReconcileAnnotation(ctx context.Context, c client.Client, obj client.Object) (modified bool, err error)
- func PatchRemoveReconcileAnnotation(ctx context.Context, c client.Client, obj client.Object) error
- func ReconcileRequestsFromObjectStructSlice[O Object[OStruct], S ~[]OStruct, OStruct any](objs S) []reconcile.Request
- type CachingReader
- type CachingReaderBuilder
- func (b *CachingReaderBuilder) AddToCache(ctx context.Context, cache *ReaderCache) error
- func (b *CachingReaderBuilder) Build(ctx context.Context) (*CachingReader, error)
- func (b *CachingReaderBuilder) BuildCache(ctx context.Context) (*ReaderCache, error)
- func (b *CachingReaderBuilder) Get(key client.ObjectKey, obj client.Object, opts ...client.GetOption) *CachingReaderBuilder
- func (b *CachingReaderBuilder) Insert(obj client.Object) *CachingReaderBuilder
- func (b *CachingReaderBuilder) InsertList(list client.ObjectList) *CachingReaderBuilder
- func (b *CachingReaderBuilder) List(list client.ObjectList, opts ...client.ListOption) *CachingReaderBuilder
- type Object
- type ReaderCache
- func (c *ReaderCache) CanList(list client.ObjectList) (bool, error)
- func (c *ReaderCache) Get(_ context.Context, key client.ObjectKey, obj client.Object, ...) error
- func (c *ReaderCache) Insert(obj client.Object) error
- func (c *ReaderCache) InsertList(list client.ObjectList) error
- func (c *ReaderCache) List(_ context.Context, list client.ObjectList, opts ...client.ListOption) error
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 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.
Types ¶
type CachingReader ¶
type CachingReader struct {
// contains filtered or unexported fields
}
func NewCachingReader ¶
func NewCachingReader(reader client.Reader, cache *ReaderCache) *CachingReader
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 (b *CachingReaderBuilder) Build(ctx context.Context) (*CachingReader, error)
func (*CachingReaderBuilder) BuildCache ¶
func (b *CachingReaderBuilder) BuildCache(ctx context.Context) (*ReaderCache, error)
func (*CachingReaderBuilder) Get ¶
func (b *CachingReaderBuilder) Get(key client.ObjectKey, obj client.Object, opts ...client.GetOption) *CachingReaderBuilder
func (*CachingReaderBuilder) Insert ¶
func (b *CachingReaderBuilder) Insert(obj client.Object) *CachingReaderBuilder
func (*CachingReaderBuilder) InsertList ¶
func (b *CachingReaderBuilder) InsertList(list client.ObjectList) *CachingReaderBuilder
func (*CachingReaderBuilder) List ¶
func (b *CachingReaderBuilder) List(list client.ObjectList, opts ...client.ListOption) *CachingReaderBuilder
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) 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
Click to show internal directories.
Click to hide internal directories.