Documentation ¶
Index ¶
- func MustNewSelectorFactory() *selectorFactory
- func NewSelectorFactory() (*selectorFactory, error)
- func SyncVolumeStatus(pvm PodVolumeModifier, podLister corelisterv1.PodLister, ...) error
- type ActualVolume
- type DesiredVolume
- type FakePodVolumeModifier
- func (pvm *FakePodVolumeModifier) GetActualVolumes(pod *corev1.Pod, vs []DesiredVolume) ([]ActualVolume, error)
- func (pvm *FakePodVolumeModifier) GetDesiredVolumes(tc *v1alpha1.TidbCluster, mt v1alpha1.MemberType) ([]DesiredVolume, error)
- func (pvm *FakePodVolumeModifier) Modify(actual []ActualVolume) error
- func (pvm *FakePodVolumeModifier) SetResult(shouldModify bool, err error)
- func (pvm *FakePodVolumeModifier) ShouldModify(actual []ActualVolume) bool
- type PVCModifierInterface
- type PodVolumeModifier
- type VolumePhase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustNewSelectorFactory ¶
func MustNewSelectorFactory() *selectorFactory
func NewSelectorFactory ¶
func NewSelectorFactory() (*selectorFactory, error)
func SyncVolumeStatus ¶
func SyncVolumeStatus(pvm PodVolumeModifier, podLister corelisterv1.PodLister, tc *v1alpha1.TidbCluster, mt v1alpha1.MemberType) error
SyncVolumeStatus lists all pods and pvc for the given component and set the volume status of tc.
Types ¶
type ActualVolume ¶
type ActualVolume struct { Desired *DesiredVolume PVC *corev1.PersistentVolumeClaim Phase VolumePhase // it may be nil if there is no permission to get pvc PV *corev1.PersistentVolume // it may be nil if there is no permission to get storage class StorageClass *storagev1.StorageClass }
func (*ActualVolume) GetStorageClassName ¶
func (v *ActualVolume) GetStorageClassName() string
get storage class name from current pvc
func (*ActualVolume) GetStorageSize ¶
func (v *ActualVolume) GetStorageSize() resource.Quantity
type DesiredVolume ¶
type DesiredVolume struct { Name v1alpha1.StorageVolumeName Size resource.Quantity // it may be nil if there is no permission to get storage class StorageClass *storagev1.StorageClass // it is sc name specified by user // the sc may not exist StorageClassName *string }
func (*DesiredVolume) GetStorageClassName ¶
func (v *DesiredVolume) GetStorageClassName() string
get storage class name from tc it may return empty because sc is unset or no permission to verify the existence of sc
func (*DesiredVolume) GetStorageSize ¶
func (v *DesiredVolume) GetStorageSize() resource.Quantity
type FakePodVolumeModifier ¶
type FakePodVolumeModifier struct { ModifyFunc func(actual []ActualVolume) error ShouldModifyFunc func(actual []ActualVolume) bool GetDesiredVolumesFunc func(tc *v1alpha1.TidbCluster, mt v1alpha1.MemberType) ([]DesiredVolume, error) GetActualVolumesFunc func(pod *corev1.Pod, vs []DesiredVolume) ([]ActualVolume, error) }
func (*FakePodVolumeModifier) GetActualVolumes ¶
func (pvm *FakePodVolumeModifier) GetActualVolumes(pod *corev1.Pod, vs []DesiredVolume) ([]ActualVolume, error)
func (*FakePodVolumeModifier) GetDesiredVolumes ¶
func (pvm *FakePodVolumeModifier) GetDesiredVolumes(tc *v1alpha1.TidbCluster, mt v1alpha1.MemberType) ([]DesiredVolume, error)
func (*FakePodVolumeModifier) Modify ¶
func (pvm *FakePodVolumeModifier) Modify(actual []ActualVolume) error
func (*FakePodVolumeModifier) SetResult ¶
func (pvm *FakePodVolumeModifier) SetResult(shouldModify bool, err error)
func (*FakePodVolumeModifier) ShouldModify ¶
func (pvm *FakePodVolumeModifier) ShouldModify(actual []ActualVolume) bool
type PVCModifierInterface ¶
type PVCModifierInterface interface {
Sync(tc *v1alpha1.TidbCluster) error
}
func NewPVCModifier ¶
func NewPVCModifier(deps *controller.Dependencies) PVCModifierInterface
type PodVolumeModifier ¶
type PodVolumeModifier interface { GetDesiredVolumes(tc *v1alpha1.TidbCluster, mt v1alpha1.MemberType) ([]DesiredVolume, error) GetActualVolumes(pod *corev1.Pod, vs []DesiredVolume) ([]ActualVolume, error) ShouldModify(actual []ActualVolume) bool Modify(actual []ActualVolume) error }
func NewPodVolumeModifier ¶
func NewPodVolumeModifier(deps *controller.Dependencies) PodVolumeModifier
type VolumePhase ¶
type VolumePhase int
const ( VolumePhaseUnknown VolumePhase = iota // 1. isPVCRevisionChanged: false // 2. needModify: true // 3. waitForNextTime: true VolumePhasePending // 1. isPVCRevisionChanged: false // 2. needModify: true // 3. waitForNextTime: false VolumePhasePreparing // 1. isPVCRevisionChanged: true // 2. needModify: true/false // 3. waitForNextTime: true/false VolumePhaseModifying // 1. isPVCRevisionChanged: false // 2. needModify: false // 3. waitForNextTime: true/false VolumePhaseModified VolumePhaseCannotModify )
func (VolumePhase) String ¶
func (p VolumePhase) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.