# Functions
DefaultFinalizerSupplier crates finalizer following to pattern `operator.{version}.{kind}.{group}`.
DefaultInformerControllerConfig returns an InformerControllerConfig with default values.
ExponentialBackoffRetryPolicy returns an Exponential Backoff RetryPolicy function, which follows the following formula: retry time = initialDelay * (2^attempt).
GetTracer returns the trace.Tracer set by SetTracer, or a tracer generated from otel.GetTracerProvider().Tracer("k8s") if none has been set.
LoadOperatorRestConfig loads an operator rest config from given path.
New creates a new Operator.
NewCannotCastError returns a new CannotCastError with data filled out from the provided resource.StaticMetadata.
NewCustomCacheInformer returns a new CustomCacheInformer using the provided cache.Store and cache.ListerWatcher.
NewInformerController creates a new controller.
NewKubernetesBasedInformer creates a new KubernetesBasedInformer for the provided schema and namespace, using the ListWatchClient provided to do its List and Watch requests.
NewKubernetesBasedInformerWithFilters creates a new KubernetesBasedInformer for the provided schema and namespace, using the ListWatchClient provided to do its List and Watch requests applying provided labelFilters if it is not empty.
NewListerWatcher returns a cache.ListerWatcher for the provided resource.Schema that uses the given ListWatchClient.
NewListMap returns a pointer to a new properly-initialized ListMap.
NewMemcachedInformer creates a new CustomCacheInformer which uses memcached as its custom cache.
NewMemcachedInformerWithFilters creates a new CustomCacheInformer which uses memcached as its custom cache.
NewMemcachedStore returns a new MemcachedStore for the specified Kind using the provided config.
NewOpinionatedReconciler creates a new OpinionatedReconciler.
NewOpinionatedWatcher sets up a new OpinionatedWatcher and returns a pointer to it.
NewOpinionatedWatcherWithFinalizer sets up a new OpinionatedWatcher with finalizer from provided supplier and returns a pointer to it.
NewRunner creates a new, properly-initialized instance of a Runner.
ReconcileActionFromResourceAction returns the equivalent ReconcileAction from a provided ResourceAction.
ResourceActionFromReconcileAction returns the equivalent ResourceAction from a provided ReconcileAction.
SetTracer sets the tracer used for generating spans for this package.
# Constants
MemcachedStoreDefaultPageSize is the default page size for MemcachedStore.List() operations.
ReconcileActionCreated indicates that the resource to reconcile has been created.
ReconcileActionDeleted indicates that the resource to reconcile has been deleted.
ReconcileActionResynced indicates a periodic or initial re-sync of existing resources in the API server.
ReconcileActionUnknown represents an Unknown ReconcileAction.
ReconcileActionUpdated indicates that the resource to reconcile has been updated.
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
DefaultErrorHandler is an error handler function which simply logs the error with the logger in the context.
DefaultRetryPolicy is an Exponential Backoff RetryPolicy with an initial 5-second delay and a max of 5 attempts.
ErrInformerAlreadyAdded indicates that there is already an informer for the resource kind mapped.
ErrNilObject indicates that a provided resource.Object is nil, and cannot be processed.
OpinionatedRetryDequeuePolicy is a RetryDequeuePolicy which has the following logic: 1.
# Structs
CannotCastError is an error that is returned by a Typed object if it cannot cast the resource.Object provided into the type the Typed object was created for.
No description provided by the author
InformerController is an object that handles coordinating informers and observers.
InformerControllerConfig contains configuration options for an InformerController.
No description provided by the author
KubernetesBasedInformer is a k8s apimachinery-based informer.
ListMap is a map of lists which is thread-safe, with read and write distinction.
ListWatchOptions are namespace, label selectors, and field selectors for filtering resources in ListWatch requests and Informers.
MemcachedStore implements cache.Store using memcached as the store for objects.
MemcachedStoreConfig is a collection of config values for a MemcachedStore.
Operator is the highest-level construct of the `operator` package, and contains one or more controllers which can be run.
OpinionatedReconciler wraps an ordinary Reconciler with finalizer-based logic to convert "Created" events into "resync" events on start-up when the reconciler has handled the "created" event on a previous run, and ensures that "delete" events are not missed during reconciler down-time by using the finalizer.
OpinionatedWatcher is a ResourceWatcher implementation that handles extra state logic, ensuring that downtime and restarts will not result in missed events.
ReconcileRequest contains the action which took place, and a snapshot of the object at that point in time.
ReconcileResult is the status of a successful Reconcile action.
RestConfigOptions are options which are applied when loading RestConfigs.
Runner runs an app.App as a standalone operator, capable of exposing admission (validation, mutation) and conversion as webhooks, and running a main control loop with reconcilers and watchers.
No description provided by the author
RunnerMetricsConfig contains configuration information for exposing prometheus metrics.
No description provided by the author
SimpleReconciler is a simple Reconciler implementation that calls ReconcileFunc if non-nil on Reconcile requests.
SimpleWatcher is a struct that implements ResourceWatcher, but takes no action on its own.
TypedReconciler is a variant of SimpleReconciler in which a user can specify the underlying type of the resource.Object which is in the provided ReconcileRequest.
TypedReconcileRequest is a variation of ReconcileRequest which uses a concretely-typed Object, rather than the interface resource.Object.
# Interfaces
Controller is an interface that describes a controller which can be run as part of an operator.
ConvertableIntoResourceObject describes any object which can be marshaled into a resource.Object.
Informer is an interface describing an informer which can be managed by InformerController.
KubernetesCompatibleWatch describes a watch response that either is wrapping a kubernetes watch.Interface, or can return a compatibility layer that implements watch.Interface.
ListWatchClient describes a client which can do ListInto and Watch requests.
PatchClient is a Client capable of making PatchInto requests.
Reconciler is an interface which describes an object which implements simple Reconciliation behavior.
ResourceObjectWrapper describes anything which wraps a resource.Object, such that it can be extracted.
ResourceWatcher describes an object which handles Add/Update/Delete actions for a resource.
# Type aliases
FinalizerSupplier represents a function that creates string finalizer from provider schema.
ReconcileAction describes the action that triggered reconciliation.
No description provided by the author
No description provided by the author
RetryDequeuePolicy is a function that defines when a retry should be dequeued when a new action is taken on a resource.
RetryPolicy is a function that defines whether an event should be retried, based on the error and number of attempts.