Documentation ¶
Index ¶
- Constants
- Variables
- func AppendEnv(a []corev1.EnvVar, b []corev1.EnvVar) []corev1.EnvVar
- func AppendEnvIfPresent(envs []corev1.EnvVar, name string) []corev1.EnvVar
- func AppendOverwriteEnv(a []corev1.EnvVar, b []corev1.EnvVar) []corev1.EnvVar
- func BuildStorageVolumeAndVolumeMount(storageVolumes []v1alpha1.StorageVolume, defaultStorageClassName *string, ...) ([]corev1.VolumeMount, []corev1.PersistentVolumeClaim)
- func ClusterClientTLSSecretName(tcName string) string
- func ClusterTLSSecretName(tcName, component string) string
- func DMClientTLSSecretName(dcName string) string
- func Encode(obj interface{}) (string, error)
- func GetAutoScalingOutSlots(tc *v1alpha1.TidbCluster, memberType v1alpha1.MemberType) sets.Int32
- func GetCrdKindFromKindName(kindName string) (v1alpha1.CrdKind, error)
- func GetDeleteSlotsNumber(annotations map[string]string) (int32, error)
- func GetOrdinalFromPodName(podName string) (int32, error)
- func GetPodName(tc *v1alpha1.TidbCluster, memberType v1alpha1.MemberType, ordinal int32) string
- func GetPodOrdinals(tc *v1alpha1.TidbCluster, memberType v1alpha1.MemberType) (sets.Int32, error)
- func GetStatefulSetName(tc *v1alpha1.TidbCluster, memberType v1alpha1.MemberType) string
- func IsOwnedByTidbCluster(obj metav1.Object) (bool, *metav1.OwnerReference)
- func IsPodOrdinalNotExceedReplicas(pod *corev1.Pod, sts *appsv1.StatefulSet) (bool, error)
- func IsStatefulSetScaling(set *appsv1.StatefulSet) bool
- func IsStatefulSetUpgrading(set *appsv1.StatefulSet) bool
- func IsSubMapOf(first map[string]string, second map[string]string) bool
- func MatchLabelFromStoreLabels(storeLabels []*metapb.StoreLabel, componentLabel string) bool
- func MustNewRequirement(key string, op selection.Operator, vals []string) *labels.Requirement
- func NewCustomResourceDefinition(crdKind v1alpha1.CrdKind, group string, labels map[string]string, ...) *extensionsobj.CustomResourceDefinition
- func OrdinalPVCName(memberType v1alpha1.MemberType, setName string, ordinal int32) string
- func ResolvePVCFromPod(pod *corev1.Pod, pvcLister corelisterv1.PersistentVolumeClaimLister) ([]*corev1.PersistentVolumeClaim, error)
- func RetainManagedFields(desiredSvc, existedSvc *corev1.Service)
- func StatefulSetEqual(new apps.StatefulSet, old apps.StatefulSet) bool
- func TiDBClientTLSSecretName(tcName string) string
- func VolumeClaimTemplate(r corev1.ResourceRequirements, metaName string, storageClassName *string) corev1.PersistentVolumeClaim
- type SortEnvByName
Constants ¶
const (
// LastAppliedConfigAnnotation is annotation key of last applied configuration
LastAppliedConfigAnnotation = "pingcap.com/last-applied-configuration"
)
Variables ¶
var ( ClusterClientTLSPath = "/var/lib/cluster-client-tls" DMClusterClientTLSPath = "/var/lib/dm-cluster-client-tls" TiDBClientTLSPath = "/var/lib/tidb-client-tls" BRBinPath = "/var/lib/br-bin" DumplingBinPath = "/var/lib/dumpling-bin" LightningBinPath = "/var/lib/lightning-bin" ClusterClientVolName = "cluster-client-tls" DMClusterClientVolName = "dm-cluster-client-tls" )
Functions ¶
func AppendEnv ¶ added in v1.1.0
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 AppendEnvIfPresent ¶ added in v1.1.4
AppendEnvIfPresent appends the given environment if present
func AppendOverwriteEnv ¶ added in v1.1.4
AppendOverwriteEnv appends envs b into a and overwrites the envs whose names already exist in b. Note that this will not change relative order of envs.
func BuildStorageVolumeAndVolumeMount ¶ added in v1.1.8
func BuildStorageVolumeAndVolumeMount(storageVolumes []v1alpha1.StorageVolume, defaultStorageClassName *string, memberType v1alpha1.MemberType) ([]corev1.VolumeMount, []corev1.PersistentVolumeClaim)
BuildStorageVolumeAndVolumeMount builds VolumeMounts and PVCs for volumes declaired in spec.storageVolumes of ComponentSpec
func ClusterClientTLSSecretName ¶ added in v1.1.0
func ClusterTLSSecretName ¶ added in v1.1.0
func DMClientTLSSecretName ¶ added in v1.2.0
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 GetDeleteSlotsNumber ¶ added in v1.1.10
func GetOrdinalFromPodName ¶ added in v0.4.0
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 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
IsSubMapOf returns whether the first map is a sub map of the second map
func MatchLabelFromStoreLabels ¶ added in v1.1.8
func MatchLabelFromStoreLabels(storeLabels []*metapb.StoreLabel, componentLabel string) bool
func MustNewRequirement ¶ added in v1.1.4
MustNewRequirement calls NewRequirement and panics on failure.
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 ResolvePVCFromPod ¶ added in v1.1.12
func ResolvePVCFromPod(pod *corev1.Pod, pvcLister corelisterv1.PersistentVolumeClaimLister) ([]*corev1.PersistentVolumeClaim, error)
ResolvePVCFromPod parses pod volumes definition, and returns all PVCs mounted by this pod
func RetainManagedFields ¶ added in v1.1.0
RetainManagedFields retains the fields in the old object that are managed by kube-controller-manager, such as node ports
func StatefulSetEqual ¶ added in v1.2.0
func StatefulSetEqual(new apps.StatefulSet, old apps.StatefulSet) bool
statefulSetEqual compares the new Statefulset's spec with old Statefulset's last applied config
func TiDBClientTLSSecretName ¶ added in v1.1.0
func VolumeClaimTemplate ¶ added in v1.1.7
func VolumeClaimTemplate(r corev1.ResourceRequirements, metaName string, storageClassName *string) corev1.PersistentVolumeClaim
Types ¶
type SortEnvByName ¶ added in v1.1.0
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)