Documentation
¶
Index ¶
- Constants
- Variables
- func DefaultControllerRateLimiter[T comparable]() workqueue.TypedRateLimiter[T]
- func EnsureNetworkPolicyForWebhook(c client.Client, logger *logrus.Entry, namespace string, ...) error
- func GetObjectMeta(r client.Object) metav1.ObjectMeta
- func GetObjectStatus(r client.Object) any
- func MustInjectTypeMeta(src, dst client.Object)
- func SetupIndexerWithManager(mgr ctrl.Manager, indexers ...Indexer) (err error)
- func SetupWebhookWithManager(mgr ctrl.Manager, client client.Client, webhookRegisters ...WebhookRegister) (err error)
- type BaseReconciler
- type Controller
- type DefaultBaseReconciler
- type DefaultController
- type DefaultReconciler
- type DefaultReconcilerAction
- type Indexer
- type Reconciler
- type ReconcilerAction
- type WebhookRegister
Constants ¶
const ( RunningPhase shared.PhaseName = "running" StartingPhase shared.PhaseName = "starting" ReadyCondition shared.ConditionName = "Ready" BaseAnnotation string = "operator-sdk-extra.webcenter.fr" ShortenError int = 5000 )
Variables ¶
var ( ErrWhenCallConfigureFromReconciler = errors.Sentinel("Error when call 'configure' from reconciler") ErrWhenCallReadFromReconciler = errors.Sentinel("Error when call 'read' from reconciler") ErrWhenCallDeleteFromReconciler = errors.Sentinel("Error when call 'delete' from reconciler") ErrWhenCallDiffFromReconciler = errors.Sentinel("Error when call 'diff' from reconciler") ErrWhenCallCreateFromReconciler = errors.Sentinel("Error when call 'create' from reconciler") ErrWhenCallUpdateFromReconciler = errors.Sentinel("Error when call 'update' from reconciler") ErrWhenCallOnSuccessFromReconciler = errors.Sentinel("Error when call 'onSuccess' from reconciler") ErrWhenCallStepReconcilerFromReconciler = errors.Sentinel("Error when call 'reconcile' from step reconciler") ErrWhenGetObjectFromReconciler = errors.Sentinel("Error when get object from reconciler") ErrWhenAddFinalizer = errors.Sentinel("Error when add finalizer") ErrWhenDeleteFinalizer = errors.Sentinel("Error when delete finalizer") ErrWhenGetObjectStatus = errors.Sentinel("Error when get object status") )
Functions ¶
func DefaultControllerRateLimiter ¶
func DefaultControllerRateLimiter[T comparable]() workqueue.TypedRateLimiter[T]
DefaultControllerRateLimiter set rate limiter that is lower agressive than the default
func EnsureNetworkPolicyForWebhook ¶ added in v2.0.6
func EnsureNetworkPolicyForWebhook(c client.Client, logger *logrus.Entry, namespace string, labels map[string]string, podSelecetors map[string]string) error
EnsureNetworkPolicyForWebhook permit to create / update NetworkPolicy for webhook
func GetObjectMeta ¶
func GetObjectMeta(r client.Object) metav1.ObjectMeta
GetObjectMeta permit to get the metata from client.Object
func GetObjectStatus ¶
GetObjectStatus permit to get the status from client.Object
func MustInjectTypeMeta ¶
MustInjectTypeMeta permit to inject the typeMeta from src to dst
func SetupIndexerWithManager ¶
SetupIndexerWithManager permit to registers indexers on manager
func SetupWebhookWithManager ¶
func SetupWebhookWithManager(mgr ctrl.Manager, client client.Client, webhookRegisters ...WebhookRegister) (err error)
SetupWebhookWithManager permit to registers webhooks on manager
Types ¶
type BaseReconciler ¶
type BaseReconciler interface {
// Client get the client
Client() client.Client
// Recorder get the recorder
Recorder() record.EventRecorder
}
BaseReconciler is the interface for all reconciler
func NewBaseReconciler ¶
func NewBaseReconciler(client client.Client, recorder record.EventRecorder) BaseReconciler
NewBaseReconciler return the default implementation of BaseReconciler interface
type Controller ¶
type Controller interface {
Reconcile(context.Context, reconcile.Request) (reconcile.Result, error)
// SetupWithManager permit to setup controller with manager
SetupWithManager(mgr ctrl.Manager) error
}
Controller is the controller interface
func NewController ¶
func NewController() Controller
NewController is the default implementation of Controller index can be nil
type DefaultBaseReconciler ¶
type DefaultBaseReconciler struct {
// contains filtered or unexported fields
}
DefaultBaseReconciler is the default implementation of BaseReconciler interface
func (*DefaultBaseReconciler) Client ¶
func (h *DefaultBaseReconciler) Client() client.Client
func (*DefaultBaseReconciler) Recorder ¶
func (h *DefaultBaseReconciler) Recorder() record.EventRecorder
type DefaultController ¶
type DefaultController struct{}
DefaultController is the default controller implementation
func (*DefaultController) SetupWithManager ¶
func (h *DefaultController) SetupWithManager(mgr ctrl.Manager) error
type DefaultReconciler ¶
type DefaultReconciler struct {
BaseReconciler
// contains filtered or unexported fields
}
DefaultReconciler is the default implementation of Reconciler interface
func (*DefaultReconciler) Finalizer ¶
func (h *DefaultReconciler) Finalizer() shared.FinalizerName
func (*DefaultReconciler) Logger ¶
func (h *DefaultReconciler) Logger() *logrus.Entry
type DefaultReconcilerAction ¶
type DefaultReconcilerAction struct {
BaseReconciler
// contains filtered or unexported fields
}
DefaultReconcilerAction is the default implementation of ReconcilerAction interface
func (*DefaultReconcilerAction) Condition ¶
func (h *DefaultReconcilerAction) Condition() shared.ConditionName
type Reconciler ¶
type Reconciler interface {
BaseReconciler
// Finalizer get the finalier name
Finalizer() shared.FinalizerName
// Logger get the logger
Logger() *logrus.Entry
}
func NewReconciler ¶
func NewReconciler(client client.Client, recorder record.EventRecorder, finalizer shared.FinalizerName, logger *logrus.Entry) Reconciler
NewReconciler is the default implementation of the Reconciler interface
type ReconcilerAction ¶
type ReconcilerAction interface {
BaseReconciler
// Condition get the condition name
Condition() shared.ConditionName
}
func NewReconcilerAction ¶
func NewReconcilerAction(client client.Client, recorder record.EventRecorder, conditionName shared.ConditionName) ReconcilerAction
NewReconcilerAction return the default implementation of ReconcilerAction