utils

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const FieldIsImmutable = "field is immutable"

Variables

This section is empty.

Functions

func AssureDeleting

func AssureDeleting(ctx context.Context, clt client.Client, object client.Object) error

AssureDeleting ensures that an object is being deleted

func AssureFinalizer

func AssureFinalizer(ctx context.Context, client client.Client, finalizerName string, object client.Object) error

AssureFinalizer ensures that a finalizer is on a given runtime object

func AssureFinalizerRemoved

func AssureFinalizerRemoved(ctx context.Context, client client.Client, finalizerName string, object client.Object) error

AssureFinalizerRemoved ensures that a finalizer does not exist anymore for a given runtime object

func CheckAndAssureFinalizer added in v0.0.7

func CheckAndAssureFinalizer(ctx context.Context, client client.Client, finalizerName string, object client.Object) (bool, error)

CheckAndAssureFinalizer ensures that a finalizer is on a given runtime object Returns false if the finalizer has been added.

func ContainsString

func ContainsString(slice []string, s string) bool

ContainsString is a helper functions to check and remove string from a slice of strings.

func GetLabel

func GetLabel(object client.Object, name string, defs ...string) string

GetLabel returns the value of a given object and label name

func GetObjectForGroupKind added in v0.0.6

func GetObjectForGroupKind(clt client.Client, gk schema.GroupKind) client.Object

func GetObjectListForGroupKind added in v0.0.6

func GetObjectListForGroupKind(clt client.Client, gk schema.GroupKind) client.ObjectList

func HasFinalizer added in v0.0.7

func HasFinalizer(object client.Object, finalizerName string) bool

func NewObjectKey added in v0.0.7

func NewObjectKey(object client.Object) client.ObjectKey

func Requeue

func Requeue(err error) (ctrl.Result, error)

Requeue requeues the object with given error

func Succeeded

func Succeeded() (ctrl.Result, error)

Succeeded returns a success result with no error

func SucceededIfNotFound

func SucceededIfNotFound(err error) (ctrl.Result, error)

SucceededIfNotFound returns a requeue result if the error is not a "NotFound" error

func ValidateFieldIsImmutatable added in v0.0.7

func ValidateFieldIsImmutatable(new, old string, fldPath *field.Path) *field.Error

ValidateFieldIsImmutatable validates if a value should be changed and returns a field.Error if that is the case.

Types

type GroupKinds added in v0.0.6

type GroupKinds map[schema.GroupKind]struct{}

func NewGroupKinds added in v0.0.6

func NewGroupKinds(ids ...schema.GroupKind) GroupKinds

func (GroupKinds) Add added in v0.0.6

func (o GroupKinds) Add(id schema.GroupKind)

func (GroupKinds) AddAll added in v0.0.6

func (o GroupKinds) AddAll(ids GroupKinds)

func (GroupKinds) Contains added in v0.0.6

func (o GroupKinds) Contains(id schema.GroupKind) bool

func (GroupKinds) Copy added in v0.0.6

func (o GroupKinds) Copy() GroupKinds

func (GroupKinds) Equal added in v0.0.6

func (o GroupKinds) Equal(ids GroupKinds) bool

func (GroupKinds) Join added in v0.0.6

func (o GroupKinds) Join(ids GroupKinds) GroupKinds

func (GroupKinds) Remove added in v0.0.6

func (o GroupKinds) Remove(id schema.GroupKind)

func (GroupKinds) String added in v0.0.6

func (o GroupKinds) String() string

type ItemListIterator added in v0.0.6

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

func MustItemListIterator added in v0.0.6

func MustItemListIterator(list client.ObjectList) *ItemListIterator

func NewItemListIterator added in v0.0.6

func NewItemListIterator(list client.ObjectList) (*ItemListIterator, error)

func (*ItemListIterator) Current added in v0.0.6

func (i *ItemListIterator) Current() client.Object

func (*ItemListIterator) HasNext added in v0.0.6

func (i *ItemListIterator) HasNext() bool

func (*ItemListIterator) Next added in v0.0.6

func (i *ItemListIterator) Next() client.Object

type ObjectId added in v0.0.6

type ObjectId struct {
	client.ObjectKey
	schema.GroupKind
}

func MustParseObjectId added in v0.0.6

func MustParseObjectId(s string) ObjectId

func NewObjectId added in v0.0.6

func NewObjectId(object client.Object) ObjectId

func NewObjectIdForRequest added in v0.0.6

func NewObjectIdForRequest(req ctrl.Request, gk schema.GroupKind) ObjectId

func ParseObjectId added in v0.0.6

func ParseObjectId(s string) (ObjectId, error)

func (ObjectId) String added in v0.0.6

func (o ObjectId) String() string

type ObjectIds added in v0.0.6

type ObjectIds map[ObjectId]struct{}

func GetOwnerIdsFor added in v0.0.6

func GetOwnerIdsFor(object client.Object) ObjectIds

func NewObjectIds added in v0.0.6

func NewObjectIds(ids ...ObjectId) ObjectIds

func (ObjectIds) Add added in v0.0.6

func (o ObjectIds) Add(id ObjectId)

func (ObjectIds) AddAll added in v0.0.6

func (o ObjectIds) AddAll(ids ObjectIds)

func (ObjectIds) Contains added in v0.0.6

func (o ObjectIds) Contains(id ObjectId) bool

func (ObjectIds) Copy added in v0.0.6

func (o ObjectIds) Copy() ObjectIds

func (ObjectIds) Equal added in v0.0.6

func (o ObjectIds) Equal(ids ObjectIds) bool

func (ObjectIds) Join added in v0.0.6

func (o ObjectIds) Join(ids ObjectIds) ObjectIds

func (ObjectIds) Remove added in v0.0.6

func (o ObjectIds) Remove(id ObjectId)

func (ObjectIds) String added in v0.0.6

func (o ObjectIds) String() string

type Ready added in v0.0.6

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

func NewReady added in v0.0.6

func NewReady(log logr.Logger, name string) *Ready

func (*Ready) Add added in v0.0.6

func (r *Ready) Add()

func (*Ready) IsReady added in v0.0.6

func (r *Ready) IsReady() bool

func (*Ready) Remove added in v0.0.6

func (r *Ready) Remove()

func (*Ready) Wait added in v0.0.6

func (r *Ready) Wait()

Directories

Path Synopsis
Package condition simplifies condition handling with any structurally compatible condition (comparable to a sort of duck-typing) via go reflection.
Package condition simplifies condition handling with any structurally compatible condition (comparable to a sort of duck-typing) via go reflection.
Package testutils provides utilities for writing (ginkgo / gomega - based) tests.
Package testutils provides utilities for writing (ginkgo / gomega - based) tests.

Jump to

Keyboard shortcuts

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