Documentation
¶
Index ¶
- Constants
- func WriteSnapshotStatus[T client.Object](ctx context.Context, cl client.Client, nn types.NamespacedName, ...) error
- type JobCreator
- type JobGetter
- type SkipStatusUpdates
- type SnapshotGetter
- type SnapshotResource
- type StatusWriter
- type StoreDebugInstanceReconciler
- type StoreExecReconciler
- type StoreReconciler
- type StoreSnapshotBaseReconciler
- type StoreSnapshotCreateReconciler
- type StoreSnapshotRestoreReconciler
- type TypedSkipStatusPredicate
Constants ¶
const ( Error = "Error" Ready = "Ready" )
Variables ¶
This section is empty.
Functions ¶
func WriteSnapshotStatus ¶
func WriteSnapshotStatus[T client.Object]( ctx context.Context, cl client.Client, nn types.NamespacedName, status v1.StoreSnapshotStatus, newResource func() T, ) error
WriteSnapshotStatus provides a generic status writer
Types ¶
type JobCreator ¶
type JobCreator func(store v1.Store, snapshot SnapshotResource) *batchv1.Job
JobCreator defines how to create the appropriate job for each snapshot type
type JobGetter ¶
type JobGetter func(ctx context.Context, client client.Client, store v1.Store, snapshot SnapshotResource) (*batchv1.Job, error)
JobGetter defines how to get the appropriate job for each snapshot type
type SkipStatusUpdates ¶
type SkipStatusUpdates = TypedSkipStatusPredicate[client.Object]
func NewSkipStatusUpdates ¶
func NewSkipStatusUpdates(logger *zap.SugaredLogger, allowList ...client.Object) (SkipStatusUpdates, error)
NewSkipStatusUpdates creates a new SkipStatusUpdates predicate with the given logger and allow list. The logger is required to prevent nil pointer panics during logging operations.
type SnapshotGetter ¶
type SnapshotGetter func(ctx context.Context, client client.Client, key types.NamespacedName) (SnapshotResource, error)
SnapshotGetter defines how to get the snapshot resource from k8s
type SnapshotResource ¶
type SnapshotResource interface {
GetRuntimeObject() runtime.Object
GetObjectMeta() metav1.Object
GetSpec() v1.StoreSnapshotSpec
GetStatus() *v1.StoreSnapshotStatus
}
SnapshotResource represents a common interface for snapshot resources
type StatusWriter ¶
type StatusWriter func(ctx context.Context, client client.Client, key types.NamespacedName, status v1.StoreSnapshotStatus) error
StatusWriter defines how to write the snapshot status back to k8s
type StoreDebugInstanceReconciler ¶
type StoreDebugInstanceReconciler struct {
client.Client
Scheme *runtime.Scheme
Recorder record.EventRecorder
Logger *zap.SugaredLogger
}
StoreDebugInstanceReconciler reconciles a StoreDebugInstance object
func (*StoreDebugInstanceReconciler) SetupWithManager ¶
func (r *StoreDebugInstanceReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type StoreExecReconciler ¶
type StoreExecReconciler struct {
client.Client
Scheme *runtime.Scheme
Recorder record.EventRecorder
Logger *zap.SugaredLogger
}
func (*StoreExecReconciler) SetupWithManager ¶
func (r *StoreExecReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type StoreReconciler ¶
type StoreReconciler struct {
client.Client
Clientset *kubernetes.Clientset
RestConfig *rest.Config
Scheme *runtime.Scheme
Recorder record.EventRecorder
DisableServiceChecks bool
EventHandlers []event.EventHandler
Logger *zap.SugaredLogger
}
StoreReconciler reconciles a Store object
func (*StoreReconciler) SetupWithManager ¶
func (r *StoreReconciler) SetupWithManager(mgr ctrl.Manager, logger *zap.SugaredLogger) error
SetupWithManager sets up the controller with the Manager.
type StoreSnapshotBaseReconciler ¶
type StoreSnapshotBaseReconciler struct {
Client client.Client
EventHandlers []event.EventHandler
Scheme *runtime.Scheme
Recorder record.EventRecorder
Logger *zap.SugaredLogger
}
StoreSnapshotBaseReconciler contains shared logic for snapshot controllers
func (*StoreSnapshotBaseReconciler) ReconcileSnapshot ¶
func (r *StoreSnapshotBaseReconciler) ReconcileSnapshot( ctx context.Context, req ctrl.Request, snapshotType string, getSnapshot SnapshotGetter, getJob JobGetter, createJob JobCreator, writeStatus StatusWriter, ) (ctrl.Result, error)
ReconcileSnapshot provides the main reconciliation logic for snapshot controllers
type StoreSnapshotCreateReconciler ¶
type StoreSnapshotCreateReconciler struct {
StoreSnapshotBaseReconciler
}
Send EVENT StoreSnapshotCreateReconciler reconciles a StoreSnapshot object
func (*StoreSnapshotCreateReconciler) SendEvent ¶
func (c *StoreSnapshotCreateReconciler) SendEvent(ctx context.Context, snap v1.StoreSnapshotCreate)
func (*StoreSnapshotCreateReconciler) SetupWithManager ¶
func (r *StoreSnapshotCreateReconciler) SetupWithManager(mgr ctrl.Manager) error
TODO: Filter if the state is failed or succeeded, because then we don't reconcile finished snapshots SetupWithManager sets up the controller with the Manager.
type StoreSnapshotRestoreReconciler ¶
type StoreSnapshotRestoreReconciler struct {
StoreSnapshotBaseReconciler
}
StoreSnapshotRestoreReconciler reconciles a StoreSnapshot object
func (*StoreSnapshotRestoreReconciler) SendEvent ¶
func (c *StoreSnapshotRestoreReconciler) SendEvent(ctx context.Context, snap v1.StoreSnapshotRestore)
func (*StoreSnapshotRestoreReconciler) SetupWithManager ¶
func (r *StoreSnapshotRestoreReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type TypedSkipStatusPredicate ¶
type TypedSkipStatusPredicate[object client.Object] struct { predicate.TypedFuncs[object] Logger *zap.SugaredLogger AllowList []client.Object }
TypedSkipStatusPredicate filters out status-only updates.
func (TypedSkipStatusPredicate[object]) Update ¶
func (t TypedSkipStatusPredicate[object]) Update(e event.TypedUpdateEvent[object]) (update bool)
Update returns false if only the status has changed, skipping reconciliation.