objectcontext

package
v1.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ObjectContext

type ObjectContext struct {
	client.Client
	Ctx    context.Context
	Log    logr.Logger
	Object client.Object
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, Client client.Client, req types.NamespacedName, object client.Object) (*ObjectContext, error)

New creates an objectContext object.

func (*ObjectContext) AppendAnnotations

func (r *ObjectContext) AppendAnnotations(annotationsToAppend map[string]string) error

AppendAnnotations appends the received annotations to objectContext.object annotations.

func (*ObjectContext) AppendLabels

func (r *ObjectContext) AppendLabels(labelsToAppend map[string]string) error

AppendLabels appends the received labels to objectContext.object labels.

func (*ObjectContext) CreateObject

func (r *ObjectContext) CreateObject() error

CreateObject creates the objectContext.object in the cluster.

func (*ObjectContext) DeleteAnnotations

func (r *ObjectContext) DeleteAnnotations(annotationsToDelete []string) error

DeleteAnnotations gets a slice of strings and deletes all the annotations with keys in the slice.

func (*ObjectContext) DeleteObject

func (r *ObjectContext) DeleteObject() error

DeleteObject deletes the objectContext.object from the cluster.

func (*ObjectContext) EnsureCreate

func (r *ObjectContext) EnsureCreate() error

EnsureCreate creates the object if it doesn't exist.

func (*ObjectContext) EnsureDelete

func (r *ObjectContext) EnsureDelete() error

EnsureDelete deletes the object if it exists.

func (*ObjectContext) EnsureUpdateObject

func (r *ObjectContext) EnsureUpdateObject(update func(object client.Object, log logr.Logger) (client.Object, logr.Logger, error), isStatusUpdate bool) error

EnsureUpdateObject force updates the object until 2 seconds timeout exceeds.

func (*ObjectContext) GetKindName

func (r *ObjectContext) GetKindName() string

GetKindName returns the object kind name.

func (*ObjectContext) IsPresent

func (r *ObjectContext) IsPresent() bool

IsPresent checks if the objectContext.object exists the cluster.

func (*ObjectContext) Name

func (r *ObjectContext) Name() string

Name returns the object name.

func (*ObjectContext) Namespace

func (r *ObjectContext) Namespace() string

Namespace returns the object namespace.

func (*ObjectContext) UpdateObject

func (r *ObjectContext) UpdateObject(update func(object client.Object, log logr.Logger) (client.Object, logr.Logger)) error

UpdateObject updates the objectContext.object in the cluster.

type ObjectContextList

type ObjectContextList struct {
	client.Client
	Ctx     context.Context
	Log     logr.Logger
	Objects client.ObjectList
}

func NewList

func NewList(ctx context.Context, Client client.Client, objects client.ObjectList, req ...client.ListOption) (*ObjectContextList, error)

NewList creates a new objectContextList object.

Jump to

Keyboard shortcuts

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