distributedrediscluster

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cause

func Cause(err error) error

Cause gives the original error

func CheackandUpdateClusterHealth added in v0.1.2

func CheackandUpdateClusterHealth(clusterStatus *rediskunv1alpha1.DistributedRedisClusterStatus, clusterInfos *redisutil.ClusterInfos, cluster *rediskunv1alpha1.DistributedRedisCluster, reqLogger logr.Logger) bool

func CheckallZonesActive added in v0.1.2

func CheckallZonesActive(cluster *redisv1alpha1.DistributedRedisCluster, reqLogger logr.Logger, Client client.Client) (bool, int32, error)

func FlagSet

func FlagSet() *pflag.FlagSet

func New

func New(msg string) error

New creates a no type error

func Newf

func Newf(msg string, args ...interface{}) error

Newf creates a no type error with formatted message

func SetClusterFailed

func SetClusterFailed(status *redisv1alpha1.DistributedRedisClusterStatus, reason string)

func SetClusterNOK added in v0.1.2

func SetClusterNOK(status *redisv1alpha1.DistributedRedisClusterStatus, reason string)

func SetClusterOK

func SetClusterOK(status *redisv1alpha1.DistributedRedisClusterStatus, reason string)

func SetClusterRebalancing

func SetClusterRebalancing(status *redisv1alpha1.DistributedRedisClusterStatus, reason string)

func SetClusterResetPassword

func SetClusterResetPassword(status *redisv1alpha1.DistributedRedisClusterStatus, reason string)

func SetClusterScaling

func SetClusterScaling(status *redisv1alpha1.DistributedRedisClusterStatus, reason string)

func SetClusterUpdating

func SetClusterUpdating(status *redisv1alpha1.DistributedRedisClusterStatus, reason string)

func SetSecretStatus

func SetSecretStatus(status *redisv1alpha1.DistributedRedisClusterStatus, secretstate string)

func Wrap

func Wrap(err error, msg string) error

Wrap an error with a string

func Wrapf

func Wrapf(err error, msg string, args ...interface{}) error

Wrapf an error with format string

Types

type DistributedRedisClusterReconciler

type DistributedRedisClusterReconciler struct {
	client.Client
	Scheme                *runtime.Scheme
	Ensurer               clustermanger.IEnsureResource
	Checker               clustermanger.ICheck
	Execer                exec.IExec
	StatefulSetController k8sutil.IStatefulSetControl
	ServiceController     k8sutil.IServiceControl
	PdbController         k8sutil.IPodDisruptionBudgetControl
	PvcController         k8sutil.IPvcControl
	CrController          k8sutil.ICustomResource
	PodController         k8sutil.IPodControl
	NodeController        k8sutil.INodeControl
}

DistributedRedisClusterReconciler reconciles a DistributedRedisCluster object

func (*DistributedRedisClusterReconciler) IsSlaveReady

func (*DistributedRedisClusterReconciler) PlaceMastersbySTS added in v0.1.2

func (r *DistributedRedisClusterReconciler) PlaceMastersbySTS(cluster *rediskunv1alpha1.DistributedRedisCluster, displacedMasters redisutil.Nodes, clusterinfos *redisutil.ClusterInfos, admin redisutil.IAdmin, context context.Context, reqLogger logr.Logger) error

func (*DistributedRedisClusterReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the DistributedRedisCluster object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile

func (*DistributedRedisClusterReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type ErrorType

type ErrorType uint

ErrorType is the type of an error

const (
	// NoType error
	NoType ErrorType = iota
	// Requeue error
	Requeue
	// Kubernetes error
	Kubernetes
	// Redis error
	Redis
	// Cluster
	Cluster
	// StopRetry stop retry error
	StopRetry
)

func GetType

func GetType(err error) ErrorType

GetType returns the error type

func (ErrorType) New

func (errorType ErrorType) New(msg string) error

New creates a new customError

func (ErrorType) Newf

func (errorType ErrorType) Newf(msg string, args ...interface{}) error

New creates a new customError with formatted message

func (ErrorType) Wrap

func (errorType ErrorType) Wrap(err error, msg string) error

Wrap creates a new wrapped error

func (ErrorType) Wrapf

func (errorType ErrorType) Wrapf(err error, msg string, args ...interface{}) error

Wrap creates a new wrapped error with formatted message

type IWaitHandle

type IWaitHandle interface {
	Name() string
	Tick() time.Duration
	Timeout() time.Duration
	Handler() error
}

Jump to

Keyboard shortcuts

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