stateful

package
v0.6.0-alpha.28 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStatefulComponent

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

Types

type Stateful

type Stateful struct {
	internal.ComponentSetBase
}

func (*Stateful) GetPhaseWhenPodsNotReady

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

GetPhaseWhenPodsNotReady gets the component phase when the pods of component are not ready.

func (*Stateful) GetPhaseWhenPodsReadyAndProbeTimeout

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

func (*Stateful) HandleRestart

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

func (*Stateful) HandleRoleChange

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

func (*Stateful) HandleUpdateWithStrategy

func (r *Stateful) HandleUpdateWithStrategy(ctx context.Context, obj client.Object,
	compStatusProcessor func(compDef *appsv1alpha1.ClusterComponentDefinition, pods []corev1.Pod, componentName string) error,
	priorityMapper func(component *appsv1alpha1.ClusterComponentDefinition) map[string]int,
	serialStrategyHandler, bestEffortParallelStrategyHandler, parallelStrategyHandler func(plan *util.Plan, pods []corev1.Pod, rolePriorityMap map[string]int)) ([]graph.Vertex, error)

HandleUpdateWithStrategy handles the update of component with strategy. REVIEW/TODO: (nashtsai)

  1. too many args

func (*Stateful) IsRunning

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

func (*Stateful) PodIsAvailable

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

func (*Stateful) PodsReady

func (r *Stateful) 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