Documentation ¶
Index ¶
- func ComposeReplicationRolePriorityMap() map[string]int
- func DefaultRole(i int32) string
- func HandleReplicationSetRoleChangeEvent(cli client.Client, reqCtx intctrlutil.RequestCtx, ...) error
- func NewReplicationComponent(cli client.Client, recorder record.EventRecorder, ...) *replicationComponent
- type ReplicationSet
- func (r *ReplicationSet) GetPhaseWhenPodsNotReady(ctx context.Context, componentName string, originPhaseIsUpRunning bool) (appsv1alpha1.ClusterComponentPhase, appsv1alpha1.ComponentMessageMap, error)
- func (r *ReplicationSet) GetPhaseWhenPodsReadyAndProbeTimeout(pods []*corev1.Pod) (appsv1alpha1.ClusterComponentPhase, appsv1alpha1.ComponentMessageMap)
- func (r *ReplicationSet) HandleRestart(ctx context.Context, obj client.Object) ([]graph.Vertex, error)
- func (r *ReplicationSet) HandleRoleChange(ctx context.Context, obj client.Object) ([]graph.Vertex, error)
- func (r *ReplicationSet) IsRunning(ctx context.Context, obj client.Object) (bool, error)
- func (r *ReplicationSet) PodIsAvailable(pod *corev1.Pod, minReadySeconds int32) bool
- func (r *ReplicationSet) PodsReady(ctx context.Context, obj client.Object) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComposeReplicationRolePriorityMap ¶
ComposeReplicationRolePriorityMap generates a priority map based on roles.
func DefaultRole ¶
DefaultRole is used to get the default role of the Pod of the Replication workload.
func HandleReplicationSetRoleChangeEvent ¶
func HandleReplicationSetRoleChangeEvent(cli client.Client, reqCtx intctrlutil.RequestCtx, cluster *appsv1alpha1.Cluster, compName string, pod *corev1.Pod, newRole string) error
HandleReplicationSetRoleChangeEvent handles the role change event of the replication workload when switchPolicy is Noop.
func NewReplicationComponent ¶
func NewReplicationComponent(cli client.Client, recorder record.EventRecorder, cluster *appsv1alpha1.Cluster, clusterVersion *appsv1alpha1.ClusterVersion, synthesizedComponent *component.SynthesizedComponent, dag *graph.DAG) *replicationComponent
Types ¶
type ReplicationSet ¶
ReplicationSet is a component object used by Cluster, ClusterComponentDefinition and ClusterComponentSpec
func (*ReplicationSet) GetPhaseWhenPodsNotReady ¶
func (r *ReplicationSet) GetPhaseWhenPodsNotReady(ctx context.Context, componentName string, originPhaseIsUpRunning bool) (appsv1alpha1.ClusterComponentPhase, appsv1alpha1.ComponentMessageMap, error)
GetPhaseWhenPodsNotReady is the implementation of the type Component interface method, when the pods of replicationSet are not ready, calculate the component phase is Failed or Abnormal. if return an empty phase, means the pods of component are ready and skips it.
func (*ReplicationSet) GetPhaseWhenPodsReadyAndProbeTimeout ¶
func (r *ReplicationSet) GetPhaseWhenPodsReadyAndProbeTimeout(pods []*corev1.Pod) (appsv1alpha1.ClusterComponentPhase, appsv1alpha1.ComponentMessageMap)
func (*ReplicationSet) HandleRestart ¶
func (r *ReplicationSet) HandleRestart(ctx context.Context, obj client.Object) ([]graph.Vertex, error)
HandleRestart is the implementation of the type Component interface method, which is used to handle the restart of the Replication workload.
func (*ReplicationSet) HandleRoleChange ¶
func (r *ReplicationSet) HandleRoleChange(ctx context.Context, obj client.Object) ([]graph.Vertex, error)
HandleRoleChange is the implementation of the type Component interface method, which is used to handle the role change of the Replication workload.
func (*ReplicationSet) IsRunning ¶
IsRunning is the implementation of the type Component interface method, which is used to check whether the replicationSet component is running normally.
func (*ReplicationSet) PodIsAvailable ¶
func (r *ReplicationSet) PodIsAvailable(pod *corev1.Pod, minReadySeconds int32) bool
PodIsAvailable is the implementation of the type Component interface method, Check whether the status of a Pod of the replicationSet is ready, including the role label on the Pod