common

package
v0.22.1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnnotationKeyRecreateStatefulset         = "redis.opstreelabs.in/recreate-statefulset"
	AnnotationKeyRecreateStatefulsetStrategy = "redis.opstreelabs.in/recreate-statefulset-strategy"
)
View Source
const (
	RedisRoleLabelKey    = "redis-role"
	RedisRoleLabelMaster = "master"
	RedisRoleLabelSlave  = "slave"
)
View Source
const (
	RedisPort             = 6379
	SentinelPort          = 26379
	RedisExporterPort     = 9121
	RedisExporterPortName = "redis-exporter"
)
View Source
const (
	RedisClusterSkipReconcileAnnotation     = "rediscluster.opstreelabs.in/skip-reconcile"
	RedisSkipReconcileAnnotation            = "redis.opstreelabs.in/skip-reconcile"
	RedisReplicationSkipReconcileAnnotation = "redisreplication.opstreelabs.in/skip-reconcile"
	RedisSentinelSkipReconcileAnnotation    = "redissentinel.opstreelabs.in/skip-reconcile"
)
View Source
const (
	EnvOperatorSTSPVCTemplateName = "OPERATOR_STS_PVC_TEMPLATE_NAME"
)
View Source
const (
	VolumeNameConfig = "config"
)

Variables

This section is empty.

Functions

func AddFinalizer added in v0.22.1

func AddFinalizer(ctx context.Context, cr client.Object, finalizer string, cl client.Client) error

AddFinalizer add finalizer for graceful deletion

func AddOwnerRefToObject added in v0.22.1

func AddOwnerRefToObject(obj metav1.Object, ownerRef metav1.OwnerReference)

AddOwnerRefToObject adds the owner references to object

func GenerateMetaInformation added in v0.22.1

func GenerateMetaInformation(resourceKind string, apiVersion string) metav1.TypeMeta

GenerateMetaInformation generates the meta information

func GenerateObjectMetaInformation added in v0.22.1

func GenerateObjectMetaInformation(name string, namespace string, labels map[string]string, annotations map[string]string) metav1.ObjectMeta

GenerateObjectMetaInformation generates the object meta information

func GetHeadlessServiceNameFromPodName added in v0.22.1

func GetHeadlessServiceNameFromPodName(podName string) string

GetHeadlessServiceNameFromPodName trims the trailing ordinal (e.g. "-0", "-1") from a pod name to derive the headless service name. If the pod name does not contain a trailing ordinal segment the original name is returned unchanged.

Examples for different Redis modes: - RedisReplication: "redis-replication-0" -> "redis-replication-headless" - RedisCluster Leader: "redis-cluster-leader-0" -> "redis-cluster-leader-headless" - RedisCluster Follower: "redis-cluster-follower-1" -> "redis-cluster-follower-headless" - RedisSentinel: "redis-sentinel-sentinel-0" -> "redis-sentinel-sentinel-headless"

func GetRedisLabels

func GetRedisLabels(name string, st SetupType, role string, labels map[string]string) map[string]string

func IsSkipReconcile

func IsSkipReconcile(ctx context.Context, obj metav1.Object) (skip bool)

func UpdateStatus added in v0.22.1

func UpdateStatus(ctx context.Context, client client.Client, obj client.Object) error

Types

type SetupType

type SetupType string
const (
	SetupTypeStandalone  SetupType = "standalone"
	SetupTypeReplication SetupType = "replication"
	SetupTypeCluster     SetupType = "cluster"
	SetupTypeSentinel    SetupType = "sentinel"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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