utils

package
v1.0.0-20221102-166735... Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LastAppliedConfigAnnotation is annotation key of last applied configuration
	LastAppliedConfigAnnotation = "pingcap.com/last-applied-configuration"
)

Variables

This section is empty.

Functions

func AddConfigMapDigestSuffix

func AddConfigMapDigestSuffix(cm *corev1.ConfigMap) error

func FindConfigMapVolume

func FindConfigMapVolume(podSpec *corev1.PodSpec, pred func(string) bool) string

FindConfigMapVolume returns the configmap which's name matches the predicate in a PodSpec, empty indicates not found

func GetStorageVolumeName

func GetStorageVolumeName(storageVolumeName string, memberType v1alpha1.MemberType) v1alpha1.StorageVolumeName

func SetStatefulSetLastAppliedConfigAnnotation

func SetStatefulSetLastAppliedConfigAnnotation(set *apps.StatefulSet) error

SetStatefulSetLastAppliedConfigAnnotation set last applied config to Statefulset's annotation

func SetUpgradePartition

func SetUpgradePartition(set *apps.StatefulSet, upgradeOrdinal int32)

SetUpgradePartition set statefulSet's rolling update partition

func Sha256Sum

func Sha256Sum(v interface{}) (string, error)

func StatefulSetEqual

func StatefulSetEqual(new apps.StatefulSet, old apps.StatefulSet) bool

StatefulSetEqual compares the new Statefulset's spec with old Statefulset's last applied config

func StatefulSetIsUpgrading

func StatefulSetIsUpgrading(set *apps.StatefulSet) bool

StatefulSetIsUpgrading confirms whether the statefulSet is upgrading phase

func UpdateConfigMapIfNeed

func UpdateConfigMapIfNeed(
	ctx context.Context,
	cli client.Client,
	configUpdateStrategy pingcapcomv1alpha1.ConfigUpdateStrategy,
	inUseName string,
	desired *corev1.ConfigMap,
) error

UpdateConfigMapIfNeed set the toml field as the old one if they are logically equal.

func UpdateStatefulSet

func UpdateStatefulSet(ctx context.Context, cli client.Client, newSet, oldSet *apps.StatefulSet) error

UpdateStatefulSet is a template function to update the statefulset of components

func UpdateStatefulSetWithPreCheck

func UpdateStatefulSetWithPreCheck(tc *v1alpha1.TiflowCluster, resaon string, newSts, oldSts *apps.StatefulSet) error

UpdateStatefulSetWithPreCheck todo: impl this logic

Types

This section is empty.

Jump to

Keyboard shortcuts

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