controller

package
v1.10.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2026 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Overview

Package controller implements the Kubernetes reconciliation logic for Valkey custom resources.

Package controller implements the Kubernetes reconciliation logic for Valkey custom resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InstanceChecker added in v1.0.1

type InstanceChecker interface {
	PingPod(ctx context.Context, v *vkov1.Valkey, podName string) error
	CheckCluster(ctx context.Context, v *vkov1.Valkey) *health.ClusterState
	GetReplicationInfo(ctx context.Context, v *vkov1.Valkey, podName string) (*valkeyclient.ReplicationInfo, error)
}

InstanceChecker verifies connectivity and health of Valkey instances. Implementations must provide PingPod for basic connectivity checks, CheckCluster for full HA cluster health verification, and GetReplicationInfo to query per-pod replication state during rolling updates.

type RollingUpdateResult

type RollingUpdateResult struct {
	// NeedsRequeue indicates that the reconciler should requeue after RequeueAfter.
	NeedsRequeue bool

	// RequeueAfter is the duration to wait before requeuing.
	RequeueAfter time.Duration

	// Completed indicates the rolling update has fully completed.
	Completed bool

	// Error holds any error encountered during the rolling update step.
	Error error
}

RollingUpdateResult describes the outcome of a rolling update step.

type ValkeyPhase

type ValkeyPhase = vkov1.ValkeyPhase

ValkeyPhase is a type alias to allow constructing rolling update phase strings.

type ValkeyReconciler

type ValkeyReconciler struct {
	client.Client
	Scheme            *runtime.Scheme
	InstanceChecker   InstanceChecker
	Recorder          events.EventRecorder
	OperatorImage     string
	OperatorNamespace string
	OperatorVersion   string
	// NewValkeyClientFn overrides the default Valkey client factory.
	// Used in unit tests to avoid real TCP connections.
	NewValkeyClientFn func(addr, password string, tlsConfig *tls.Config) *valkeyclient.Client
}

ValkeyReconciler reconciles a Valkey object.

func (*ValkeyReconciler) Reconcile

func (r *ValkeyReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile handles a reconciliation request for a Valkey resource.

func (*ValkeyReconciler) SetupWithManager

func (r *ValkeyReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL