Documentation
¶
Index ¶
- func AppendIfNotExists(list []string, item string) []string
- func RemoveIfExists(list []string, item string) []string
- func UpdateResource(ctx context.Context, logger logr.Logger, c client.Writer, object client.Object, ...) error
- func UpdateResourceStatus(ctx context.Context, logger logr.Logger, c client.StatusWriter, ...) error
- type SafeRecorder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendIfNotExists ¶
AppendIfNotExists adds an item to the provided list if it not exists.
func RemoveIfExists ¶
RemoveIfExists removes an item from the provided list if it exists.
func UpdateResource ¶
func UpdateResource( ctx context.Context, logger logr.Logger, c client.Writer, object client.Object, name string, ) error
UpdateResource tries to update the provided object by using the client.Writer. If the update fails, it automatically logs to the provided logger.
func UpdateResourceStatus ¶ added in v0.5.0
func UpdateResourceStatus( ctx context.Context, logger logr.Logger, c client.StatusWriter, object client.Object, name string, ) error
UpdateResourceStatus tries to update the provided object by using the client.StatusWriter. If the update fails, it automatically logs to the provided logger.
Types ¶
type SafeRecorder ¶ added in v0.5.0
type SafeRecorder struct {
// contains filtered or unexported fields
}
func NewSafeRecorder ¶ added in v0.5.0
func NewSafeRecorder(recorder record.EventRecorder) *SafeRecorder
func (*SafeRecorder) AnnotatedEventf ¶ added in v0.5.0
func (sr *SafeRecorder) AnnotatedEventf( object runtime.Object, annotations map[string]string, eventtype, reason, messageFmt string, args ...interface{}, )
AnnotatedEventf is just like eventf, but with annotations attached.
Click to show internal directories.
Click to hide internal directories.