consensus

package
v0.6.0-alpha.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComposeRolePriorityMap

func ComposeRolePriorityMap(consensusSpec *appsv1alpha1.ConsensusSetSpec) map[string]int

ComposeRolePriorityMap generates a priority map based on roles.

func NewConsensusComponent

func NewConsensusComponent(cli client.Client,
	recorder record.EventRecorder,
	cluster *appsv1alpha1.Cluster,
	clusterVersion *appsv1alpha1.ClusterVersion,
	synthesizedComponent *component.SynthesizedComponent,
	dag *graph.DAG) *consensusComponent

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 ConsensusSet

type ConsensusSet struct {
	stateful.Stateful
}

func (*ConsensusSet) GetPhaseWhenPodsNotReady

func (r *ConsensusSet) GetPhaseWhenPodsNotReady(ctx context.Context,
	componentName string) (appsv1alpha1.ClusterComponentPhase, appsv1alpha1.ComponentMessageMap, error)

func (*ConsensusSet) GetPhaseWhenPodsReadyAndProbeTimeout

func (r *ConsensusSet) GetPhaseWhenPodsReadyAndProbeTimeout(pods []*corev1.Pod) (appsv1alpha1.ClusterComponentPhase, appsv1alpha1.ComponentMessageMap)

func (*ConsensusSet) HandleHA

func (r *ConsensusSet) HandleHA(ctx context.Context, obj client.Object) ([]graph.Vertex, error)

func (*ConsensusSet) HandleRestart

func (r *ConsensusSet) HandleRestart(ctx context.Context, obj client.Object) ([]graph.Vertex, error)

func (*ConsensusSet) HandleRoleChange

func (r *ConsensusSet) HandleRoleChange(ctx context.Context, obj client.Object) ([]graph.Vertex, error)

func (*ConsensusSet) IsRunning

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

func (*ConsensusSet) PodIsAvailable

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

func (*ConsensusSet) PodsReady

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

func (*ConsensusSet) SetComponent

func (r *ConsensusSet) SetComponent(comp types.Component)

Jump to

Keyboard shortcuts

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