Documentation ¶
Index ¶
- func ConvertRSMToSTS(rsm *workloads.ReplicatedStateMachine) *appsv1.StatefulSet
- func GetClusterByObject(ctx context.Context, cli client.Client, obj client.Object) (*appsv1alpha1.Cluster, error)
- func GetComponentDeployMinReadySeconds(ctx context.Context, cli client.Client, cluster appsv1alpha1.Cluster, ...) (minReadySeconds int32, err error)
- func GetComponentInfoByPod(ctx context.Context, cli client.Client, cluster appsv1alpha1.Cluster, ...) (componentName string, componentDef *appsv1alpha1.ClusterComponentDefinition, ...)
- func GetComponentPodList(ctx context.Context, cli client.Client, cluster appsv1alpha1.Cluster, ...) (*corev1.PodList, error)
- func GetComponentPodListWithRole(ctx context.Context, cli client.Client, cluster appsv1alpha1.Cluster, ...) (*corev1.PodList, error)
- func GetComponentStsMinReadySeconds(ctx context.Context, cli client.Client, cluster appsv1alpha1.Cluster, ...) (minReadySeconds int32, err error)
- func GetComponentWorkloadMinReadySeconds(ctx context.Context, cli client.Client, cluster appsv1alpha1.Cluster, ...) (minReadySeconds int32, err error)
- func IsComponentPodsWithLatestRevision(ctx context.Context, cli client.Client, cluster *appsv1alpha1.Cluster, ...) (bool, error)
- func IsFailedOrAbnormal(phase appsv1alpha1.ClusterComponentPhase) bool
- type Component
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertRSMToSTS ¶ added in v0.7.0
func ConvertRSMToSTS(rsm *workloads.ReplicatedStateMachine) *appsv1.StatefulSet
ConvertRSMToSTS converts a rsm to sts TODO(free6om): refactor this func out
func GetClusterByObject ¶ added in v0.6.0
func GetClusterByObject(ctx context.Context, cli client.Client, obj client.Object) (*appsv1alpha1.Cluster, error)
GetClusterByObject gets cluster by related k8s workloads.
func GetComponentDeployMinReadySeconds ¶ added in v0.6.0
func GetComponentDeployMinReadySeconds(ctx context.Context, cli client.Client, cluster appsv1alpha1.Cluster, componentName string) (minReadySeconds int32, err error)
GetComponentDeployMinReadySeconds gets the deployment minReadySeconds of the component.
func GetComponentInfoByPod ¶ added in v0.6.0
func GetComponentInfoByPod(ctx context.Context, cli client.Client, cluster appsv1alpha1.Cluster, pod *corev1.Pod) (componentName string, componentDef *appsv1alpha1.ClusterComponentDefinition, err error)
GetComponentInfoByPod gets componentName and componentDefinition info by Pod.
func GetComponentPodList ¶ added in v0.6.0
func GetComponentPodList(ctx context.Context, cli client.Client, cluster appsv1alpha1.Cluster, componentName string) (*corev1.PodList, error)
GetComponentPodList gets the pod list by cluster and componentName
func GetComponentPodListWithRole ¶ added in v0.6.0
func GetComponentPodListWithRole(ctx context.Context, cli client.Client, cluster appsv1alpha1.Cluster, compSpecName, role string) (*corev1.PodList, error)
GetComponentPodListWithRole gets the pod list with target role by cluster and componentName
func GetComponentStsMinReadySeconds ¶ added in v0.6.0
func GetComponentStsMinReadySeconds(ctx context.Context, cli client.Client, cluster appsv1alpha1.Cluster, componentName string) (minReadySeconds int32, err error)
GetComponentStsMinReadySeconds gets the statefulSet minReadySeconds of the component.
func GetComponentWorkloadMinReadySeconds ¶ added in v0.6.0
func GetComponentWorkloadMinReadySeconds(ctx context.Context, cli client.Client, cluster appsv1alpha1.Cluster, workloadType appsv1alpha1.WorkloadType, componentName string) (minReadySeconds int32, err error)
GetComponentWorkloadMinReadySeconds gets the workload minReadySeconds of the component.
func IsComponentPodsWithLatestRevision ¶ added in v0.7.0
func IsComponentPodsWithLatestRevision(ctx context.Context, cli client.Client, cluster *appsv1alpha1.Cluster, rsm *workloads.ReplicatedStateMachine) (bool, error)
IsComponentPodsWithLatestRevision checks whether the underlying pod spec matches the one declared in the Cluster/Component.
func IsFailedOrAbnormal ¶ added in v0.6.0
func IsFailedOrAbnormal(phase appsv1alpha1.ClusterComponentPhase) bool
Types ¶
type Component ¶ added in v0.6.0
type Component interface { GetName() string GetNamespace() string GetClusterName() string GetCluster() *appsv1alpha1.Cluster GetClusterVersion() *appsv1alpha1.ClusterVersion GetSynthesizedComponent() *component.SynthesizedComponent Create(reqCtx intctrlutil.RequestCtx, cli client.Client) error Delete(reqCtx intctrlutil.RequestCtx, cli client.Client) error Update(reqCtx intctrlutil.RequestCtx, cli client.Client) error Status(reqCtx intctrlutil.RequestCtx, cli client.Client) error }
func NewComponent ¶ added in v0.6.0
func NewComponent(reqCtx intctrlutil.RequestCtx, cli client.Client, definition *appsv1alpha1.ClusterDefinition, version *appsv1alpha1.ClusterVersion, cluster *appsv1alpha1.Cluster, compName string, dag *graph.DAG) (Component, error)