util

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendEnv

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

func ClusterClientTLSSecretName(tcName string) string

func ClusterTLSSecretName

func ClusterTLSSecretName(tcName, component string) string

func Encode

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

func GetOrdinalFromPodName

func GetOrdinalFromPodName(podName string) (int32, error)

func GetPodName

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

func GetPodOrdinals

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

GetPodOrdinals gets desired ordials of member in given TikvCluster.

func GetStatefulSetName

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

func IsOwnedByTikvCluster

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

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

func IsPodOrdinalNotExceedReplicas

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

func IsStatefulSetScaling

func IsStatefulSetScaling(set *appsv1.StatefulSet) bool

func IsStatefulSetUpgrading

func IsStatefulSetUpgrading(set *appsv1.StatefulSet) bool

func IsSubMapOf

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 OrdinalPVCName

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

func RetainManagedFields

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

func TiDBClientTLSSecretName(tcName string) string

Types

type SortEnvByName

type SortEnvByName []corev1.EnvVar

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

func (SortEnvByName) Len

func (e SortEnvByName) Len() int

func (SortEnvByName) Less

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

func (SortEnvByName) Swap

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