Documentation ¶
Index ¶
- type ObjectContext
- func (r *ObjectContext) AppendAnnotations(annotationsToAppend map[string]string) error
- func (r *ObjectContext) AppendLabels(labelsToAppend map[string]string) error
- func (r *ObjectContext) CreateObject() error
- func (r *ObjectContext) DeleteAnnotations(annotationsToDelete []string) error
- func (r *ObjectContext) DeleteObject() error
- func (r *ObjectContext) EnsureCreate() error
- func (r *ObjectContext) EnsureDelete() error
- func (r *ObjectContext) EnsureUpdateObject(...) error
- func (r *ObjectContext) GetKindName() string
- func (r *ObjectContext) IsPresent() bool
- func (r *ObjectContext) Name() string
- func (r *ObjectContext) Namespace() string
- func (r *ObjectContext) UpdateObject(...) error
- type ObjectContextList
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) Namespace ¶
func (r *ObjectContext) Namespace() string
Namespace returns the object namespace.
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.