Documentation ¶
Index ¶
- func ComposeRolePriorityMap(component appsv1alpha1.ClusterComponentDefinition) map[string]int
- func NewConsensusComponent(cli client.Client, cluster *appsv1alpha1.Cluster, ...) (types.Component, error)
- func SortPods(pods []corev1.Pod, rolePriorityMap map[string]int)
- func UpdateConsensusSetRoleLabel(cli client.Client, reqCtx intctrlutil.RequestCtx, ...) error
- type ConsensusComponent
- func (r *ConsensusComponent) GetPhaseWhenPodsNotReady(ctx context.Context, componentName string) (appsv1alpha1.ClusterComponentPhase, error)
- func (r *ConsensusComponent) HandleProbeTimeoutWhenPodsReady(ctx context.Context, recorder record.EventRecorder) (bool, error)
- func (r *ConsensusComponent) HandleUpdate(ctx context.Context, obj client.Object) error
- func (r *ConsensusComponent) IsRunning(ctx context.Context, obj client.Object) (bool, error)
- func (r *ConsensusComponent) PodIsAvailable(pod *corev1.Pod, minReadySeconds int32) bool
- func (r *ConsensusComponent) PodsReady(ctx context.Context, obj client.Object) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComposeRolePriorityMap ¶
func ComposeRolePriorityMap(component appsv1alpha1.ClusterComponentDefinition) map[string]int
ComposeRolePriorityMap generates a priority map based on roles.
func NewConsensusComponent ¶
func NewConsensusComponent( cli client.Client, cluster *appsv1alpha1.Cluster, component *appsv1alpha1.ClusterComponentSpec, componentDef appsv1alpha1.ClusterComponentDefinition) (types.Component, error)
func UpdateConsensusSetRoleLabel ¶
func UpdateConsensusSetRoleLabel(cli client.Client, reqCtx intctrlutil.RequestCtx, componentDef *appsv1alpha1.ClusterComponentDefinition, pod *corev1.Pod, role string) error
UpdateConsensusSetRoleLabel updates pod role label when internal container role changed
Types ¶
type ConsensusComponent ¶
type ConsensusComponent struct {
stateful.StatefulComponent
}
func (*ConsensusComponent) GetPhaseWhenPodsNotReady ¶
func (r *ConsensusComponent) GetPhaseWhenPodsNotReady(ctx context.Context, componentName string) (appsv1alpha1.ClusterComponentPhase, error)
func (*ConsensusComponent) HandleProbeTimeoutWhenPodsReady ¶
func (r *ConsensusComponent) HandleProbeTimeoutWhenPodsReady(ctx context.Context, recorder record.EventRecorder) (bool, error)
func (*ConsensusComponent) HandleUpdate ¶
func (*ConsensusComponent) PodIsAvailable ¶
func (r *ConsensusComponent) PodIsAvailable(pod *corev1.Pod, minReadySeconds int32) bool
Click to show internal directories.
Click to hide internal directories.