Documentation ¶
Overview ¶
Package reconcilerutil holds utility functions for Kf reconcilers similar to go's ioutil and httputil packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AddFinalizer = controllerutil.AddFinalizer
AddFinalizer adds a finalizer to the given object.
var RemoveFinalizer = controllerutil.RemoveFinalizer
RemoveFinalizer removes a finalizer from the given object.
Functions ¶
func HasFinalizer ¶
HasFinalizer checks if an object has a finalizer.
func HealthCheckerMain ¶
func HealthCheckerMain(ctx context.Context, addr, component string, ctors ...injection.ControllerConstructor)
HealthCheckerMain wraps sharedmain.Main and therefore blocks until the controller is shutdown. The main difference is it starts a health endpoint on addr. Any constructor that implements HealthChecker will be used to determine if the endpoint returns a 204 or a 503.
func IsConflictOSBError ¶
Types ¶
type HealthChecker ¶
HealthChecker has a Healthy method that gets invoked periodically to determine the health of the controller.
type StructuredStatsReporter ¶ added in v2.11.16
type StructuredStatsReporter struct { // Logger to write structured output to. // Must be set before Report functions are called. Logger *zap.SugaredLogger // Clock is an optional clock. Clock func() time.Time // contains filtered or unexported fields }
StructuredStatsReporter logs events
func (*StructuredStatsReporter) MaybeReport ¶ added in v2.11.16
func (s *StructuredStatsReporter) MaybeReport() bool
MaybeReport writes a report to the logger if it hasn't been done recently. Returns true if the report was triggered and the internal state was updated.
func (*StructuredStatsReporter) ReportQueueDepth ¶ added in v2.11.16
func (s *StructuredStatsReporter) ReportQueueDepth(v int64) error
ReportQueueDepth reports the queue depth metric
func (*StructuredStatsReporter) ReportReconcile ¶ added in v2.11.16
func (s *StructuredStatsReporter) ReportReconcile(duration time.Duration, success string, key types.NamespacedName) error
ReportReconcile reports the count and latency metrics for a reconcile operation