consensus

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2023 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

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 SortPods

func SortPods(pods []corev1.Pod, rolePriorityMap map[string]int)

SortPods sorts pods by their role priority

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 (r *ConsensusComponent) HandleUpdate(ctx context.Context, obj client.Object) error

func (*ConsensusComponent) IsRunning

func (r *ConsensusComponent) IsRunning(ctx context.Context, obj client.Object) (bool, error)

func (*ConsensusComponent) PodIsAvailable

func (r *ConsensusComponent) PodIsAvailable(pod *corev1.Pod, minReadySeconds int32) bool

func (*ConsensusComponent) PodsReady

func (r *ConsensusComponent) PodsReady(ctx context.Context, obj client.Object) (bool, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL