util

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2020 License: Apache-2.0 Imports: 16 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ClusterClientTLSPath = "/var/lib/cluster-client-tls"
	TiDBClientTLSPath    = "/var/lib/tidb-client-tls"
	ClusterClientVolName = "cluster-client-tls"
)

Functions

func AppendEnv added in v1.1.0

func AppendEnv(a []corev1.EnvVar, b []corev1.EnvVar) []corev1.EnvVar

AppendEnv appends envs `b` into `a` ignoring envs whose names already exist in `b`. Note that this will not change relative order of envs.

func ClusterClientTLSSecretName added in v1.1.0

func ClusterClientTLSSecretName(tcName string) string

func ClusterTLSSecretName added in v1.1.0

func ClusterTLSSecretName(tcName, component string) string

func Encode added in v1.1.0

func Encode(obj interface{}) (string, error)

func GetAutoScalingOutSlots added in v1.1.0

func GetAutoScalingOutSlots(tc *v1alpha1.TidbCluster, memberType v1alpha1.MemberType) sets.Int32

func GetCrdKindFromKindName added in v1.1.0

func GetCrdKindFromKindName(kindName string) (v1alpha1.CrdKind, error)

func GetOrdinalFromPodName added in v0.4.0

func GetOrdinalFromPodName(podName string) (int32, error)

func GetPodName added in v1.1.0

func GetPodName(tc *v1alpha1.TidbCluster, memberType v1alpha1.MemberType, ordinal int32) string

func GetPodOrdinals added in v1.1.0

func GetPodOrdinals(tc *v1alpha1.TidbCluster, memberType v1alpha1.MemberType) (sets.Int32, error)

GetPodOrdinals gets desired ordials of member in given TidbCluster.

func GetStatefulSetName added in v1.1.0

func GetStatefulSetName(tc *v1alpha1.TidbCluster, memberType v1alpha1.MemberType) string

func IsOwnedByTidbCluster added in v1.1.0

func IsOwnedByTidbCluster(obj metav1.Object) (bool, *metav1.OwnerReference)

IsOwnedByTidbCluster checks if the given object is owned by TidbCluster. Schema Kind and Group are checked, Version is ignored.

func IsPodOrdinalNotExceedReplicas added in v1.1.0

func IsPodOrdinalNotExceedReplicas(pod *corev1.Pod, sts *appsv1.StatefulSet) (bool, error)

func IsStatefulSetScaling added in v1.1.0

func IsStatefulSetScaling(set *appsv1.StatefulSet) bool

func IsStatefulSetUpgrading added in v1.1.0

func IsStatefulSetUpgrading(set *appsv1.StatefulSet) bool

func IsSubMapOf added in v1.1.0

func IsSubMapOf(first map[string]string, second map[string]string) bool

IsSubMapOf returns whether the first map is a sub map of the second map

func NewCustomResourceDefinition added in v1.1.0

func NewCustomResourceDefinition(crdKind v1alpha1.CrdKind, group string, labels map[string]string, validation bool) *extensionsobj.CustomResourceDefinition

func OrdinalPVCName added in v1.1.0

func OrdinalPVCName(memberType v1alpha1.MemberType, setName string, ordinal int32) string

func RetainManagedFields added in v1.1.0

func RetainManagedFields(desiredSvc, existedSvc *corev1.Service)

RetainManagedFields retains the fields in the old object that are managed by kube-controller-manager, such as node ports

func TiDBClientTLSSecretName added in v1.1.0

func TiDBClientTLSSecretName(tcName string) string

Types

type SortEnvByName added in v1.1.0

type SortEnvByName []corev1.EnvVar

SortEnvByName implements sort.Interface to sort env list by name.

func (SortEnvByName) Len added in v1.1.0

func (e SortEnvByName) Len() int

func (SortEnvByName) Less added in v1.1.0

func (e SortEnvByName) Less(i, j int) bool

func (SortEnvByName) Swap added in v1.1.0

func (e SortEnvByName) Swap(i, j int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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