Documentation ¶
Index ¶
- Constants
- func AddConfigMapDigestSuffix(cm *corev1.ConfigMap) error
- func FindConfigMapVolume(podSpec *corev1.PodSpec, pred func(string) bool) string
- func SetStatefulSetLastAppliedConfigAnnotation(set *apps.StatefulSet) error
- func SetUpgradePartition(set *apps.StatefulSet, upgradeOrdinal int32)
- func Sha256Sum(v interface{}) (string, error)
- func StatefulSetIsUpgrading(set *apps.StatefulSet) bool
- func UpdateConfigMapIfNeed(cmLister corelisters.ConfigMapLister, ...) error
- func UpdateStatefulSet(setCtl controller.StatefulSetControlInterface, object runtime.Object, ...) error
- func UpdateStatefulSetWithPrecheck(deps *controller.Dependencies, tc *v1alpha1.TidbCluster, reason string, ...) error
- type ContainerBuilder
- type PodTemplateSpecBuilder
- func (b *PodTemplateSpecBuilder) AddAnnotations(annos map[string]string)
- func (pb *PodTemplateSpecBuilder) AddContainers(containers ...corev1.Container)
- func (b *PodTemplateSpecBuilder) AddLabels(labels map[string]string)
- func (b *PodTemplateSpecBuilder) AddVolumes(volumes ...corev1.Volume)
- func (pb *PodTemplateSpecBuilder) Clone() *corev1.PodTemplateSpec
- func (pb *PodTemplateSpecBuilder) ContainerBuilder(name string) *ContainerBuilder
- func (pb *PodTemplateSpecBuilder) Get() *corev1.PodTemplateSpec
- type StatefulSetBuilder
Constants ¶
const (
// LastAppliedConfigAnnotation is annotation key of last applied configuration
LastAppliedConfigAnnotation = "pingcap.com/last-applied-configuration"
)
Variables ¶
This section is empty.
Functions ¶
func FindConfigMapVolume ¶
FindConfigMapVolume returns the configmap which's name matches the predicate in a PodSpec, empty indicates not found
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 StatefulSetIsUpgrading ¶
func StatefulSetIsUpgrading(set *apps.StatefulSet) bool
StatefulSetIsUpgrading confirms whether the statefulSet is upgrading phase
func UpdateConfigMapIfNeed ¶
func UpdateConfigMapIfNeed( cmLister corelisters.ConfigMapLister, configUpdateStrategy v1alpha1.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(setCtl controller.StatefulSetControlInterface, object runtime.Object, newSet, oldSet *apps.StatefulSet) error
UpdateStatefulSet is a template function to update the statefulset of components
func UpdateStatefulSetWithPrecheck ¶
func UpdateStatefulSetWithPrecheck( deps *controller.Dependencies, tc *v1alpha1.TidbCluster, reason string, newTiDBSet *apps.StatefulSet, oldTiDBSet *apps.StatefulSet, ) error
Types ¶
type ContainerBuilder ¶
type ContainerBuilder struct {
// contains filtered or unexported fields
}
func NewContainerBuilder ¶
func NewContainerBuilder(container *corev1.Container) *ContainerBuilder
func (*ContainerBuilder) AddEnvs ¶
func (cb *ContainerBuilder) AddEnvs(envs ...corev1.EnvVar)
func (*ContainerBuilder) AddVolumeMounts ¶
func (cb *ContainerBuilder) AddVolumeMounts(mounts ...corev1.VolumeMount)
func (*ContainerBuilder) Clone ¶
func (cb *ContainerBuilder) Clone() *corev1.Container
func (*ContainerBuilder) Get ¶
func (cb *ContainerBuilder) Get() *corev1.Container
type PodTemplateSpecBuilder ¶
type PodTemplateSpecBuilder struct {
// contains filtered or unexported fields
}
func NewPodTemplateSpecBuilder ¶
func NewPodTemplateSpecBuilder(podTemplate *corev1.PodTemplateSpec) *PodTemplateSpecBuilder
func (*PodTemplateSpecBuilder) AddAnnotations ¶
func (b *PodTemplateSpecBuilder) AddAnnotations(annos map[string]string)
func (*PodTemplateSpecBuilder) AddContainers ¶
func (pb *PodTemplateSpecBuilder) AddContainers(containers ...corev1.Container)
AddContainers add container to pod's spec
NOTE: if container slice expand, old ContainerBuilder reference will be outdated.
func (*PodTemplateSpecBuilder) AddLabels ¶
func (b *PodTemplateSpecBuilder) AddLabels(labels map[string]string)
func (*PodTemplateSpecBuilder) AddVolumes ¶
func (b *PodTemplateSpecBuilder) AddVolumes(volumes ...corev1.Volume)
func (*PodTemplateSpecBuilder) Clone ¶
func (pb *PodTemplateSpecBuilder) Clone() *corev1.PodTemplateSpec
func (*PodTemplateSpecBuilder) ContainerBuilder ¶
func (pb *PodTemplateSpecBuilder) ContainerBuilder(name string) *ContainerBuilder
ContainerBuilder return the specified container builder
NOTE: don't save the builder, it will be outdated if container slice expand
func (*PodTemplateSpecBuilder) Get ¶
func (pb *PodTemplateSpecBuilder) Get() *corev1.PodTemplateSpec
type StatefulSetBuilder ¶
type StatefulSetBuilder struct {
// contains filtered or unexported fields
}
func NewStatefulSetBuilder ¶
func NewStatefulSetBuilder(sts *apps.StatefulSet) *StatefulSetBuilder
func (*StatefulSetBuilder) AddVolumeClaims ¶
func (sb *StatefulSetBuilder) AddVolumeClaims(pvcs ...corev1.PersistentVolumeClaim)
func (*StatefulSetBuilder) Clone ¶
func (sb *StatefulSetBuilder) Clone() *apps.StatefulSet
func (*StatefulSetBuilder) Get ¶
func (sb *StatefulSetBuilder) Get() *apps.StatefulSet
func (*StatefulSetBuilder) PodTemplateSpecBuilder ¶
func (sb *StatefulSetBuilder) PodTemplateSpecBuilder() *PodTemplateSpecBuilder