Documentation ¶
Index ¶
- Constants
- type SubController
- type SubDefaultController
- func (d *SubDefaultController) CheckConfigMountPath(dcr *dorisv1.DorisCluster, componentType dorisv1.ComponentType)
- func (d *SubDefaultController) ClassifyPodsByStatus(namespace string, status *dorisv1.ComponentStatus, labels map[string]string, ...) error
- func (d *SubDefaultController) ClearCommonResources(ctx context.Context, dcr *dorisv1.DorisCluster, ...) (bool, error)
- func (d *SubDefaultController) FeAvailable(dcr *dorisv1.DorisCluster) bool
- func (d *SubDefaultController) GetConfig(ctx context.Context, configMapInfo *dorisv1.ConfigMapInfo, namespace string, ...) (map[string]interface{}, error)
- func (d *SubDefaultController) PrepareReconcileResources(ctx context.Context, dcr *dorisv1.DorisCluster, ...) bool
- func (d *SubDefaultController) RestrictConditionsEqual(nst *appv1.StatefulSet, est *appv1.StatefulSet)
- func (d *SubDefaultController) UpdateStatus(namespace string, status *dorisv1.ComponentStatus, labels map[string]string, ...) error
Constants ¶
const ( EventNormal = "Normal" EventWarning = "Warning" )
define event type for sub controller, Type can be one of Normal, Warning.
const ( StatefulSetNotExist = "StatefulSetNotExist" AutoScalerDeleteFailed = "AutoScalerDeleteFailed" ComponentImageUpdate = "ComponentImageUpdate" PVCListFailed = "PVCListFailed" PVCUpdate = "PVCUpdated" PVCUpdateFailed = "PVCUpdateFailed" PVCCreate = "PVCCreate" PVCCreateFailed = "PVCCreateFailed" FollowerScaleDownFailed = "FollowerScaleDownFailed" ConfigMapPathRepeated = "ConfigMapPathRepeated" )
'reason' should be short and unique; it should be in UpperCamelCase format (starting with a capital letter).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SubController ¶
type SubController interface { //Sync reconcile for sub controller. bool represent the component have updated. Sync(ctx context.Context, cluster *dorisv1.DorisCluster) error //clear all resource about sub-component. ClearResources(ctx context.Context, cluster *dorisv1.DorisCluster) (bool, error) //return the controller name, beController, feController,cnController for log. GetControllerName() string //UpdateStatus update the component status on src. UpdateComponentStatus(cluster *dorisv1.DorisCluster) error }
type SubDefaultController ¶
type SubDefaultController struct { K8sclient client.Client K8srecorder record.EventRecorder }
SubDefaultController define common function for all component about doris.
func (*SubDefaultController) CheckConfigMountPath ¶
func (d *SubDefaultController) CheckConfigMountPath(dcr *dorisv1.DorisCluster, componentType dorisv1.ComponentType)
func (*SubDefaultController) ClassifyPodsByStatus ¶
func (d *SubDefaultController) ClassifyPodsByStatus(namespace string, status *dorisv1.ComponentStatus, labels map[string]string, replicas int32) error
func (*SubDefaultController) ClearCommonResources ¶
func (d *SubDefaultController) ClearCommonResources(ctx context.Context, dcr *dorisv1.DorisCluster, componentType dorisv1.ComponentType) (bool, error)
ClearCommonResources clear common resources all component have, as statefulset, service. response `bool` represents all resource have deleted, if not and delete resource failed return false for next reconcile retry.
func (*SubDefaultController) FeAvailable ¶
func (d *SubDefaultController) FeAvailable(dcr *dorisv1.DorisCluster) bool
func (*SubDefaultController) GetConfig ¶
func (d *SubDefaultController) GetConfig(ctx context.Context, configMapInfo *dorisv1.ConfigMapInfo, namespace string, componentType dorisv1.ComponentType) (map[string]interface{}, error)
func (*SubDefaultController) PrepareReconcileResources ¶
func (d *SubDefaultController) PrepareReconcileResources(ctx context.Context, dcr *dorisv1.DorisCluster, componentType dorisv1.ComponentType) bool
PrepareReconcileResources prepare resource for reconcile response: bool, if true presents resource have ready for reconciling, if false presents resource is preparing.
func (*SubDefaultController) RestrictConditionsEqual ¶
func (d *SubDefaultController) RestrictConditionsEqual(nst *appv1.StatefulSet, est *appv1.StatefulSet)
RestrictConditionsEqual adds two StatefulSet, It is used to control the conditions for comparing. nst StatefulSet - a new StatefulSet est StatefulSet - an old StatefulSet
func (*SubDefaultController) UpdateStatus ¶
func (d *SubDefaultController) UpdateStatus(namespace string, status *dorisv1.ComponentStatus, labels map[string]string, replicas int32) error
UpdateStatus update the component status on src.