Documentation ¶
Index ¶
- func BuildRestoredInfo(reqCtx intctrlutil.RequestCtx, cli client.Client, namespace string, ...) error
- func BuildRestoredInfo2(component *SynthesizedComponent, backup *dataprotectionv1alpha1.Backup, ...) error
- func GenerateConnCredential(clusterName string) string
- func GetClusterDefCompByName(clusterDef appsv1alpha1.ClusterDefinition, cluster appsv1alpha1.Cluster, ...) *appsv1alpha1.ClusterComponentDefinition
- func GetEnvReplacementMapForConnCredential(clusterName string) map[string]string
- func GetReplacementMapForBuiltInEnv(cluster *appsv1alpha1.Cluster, componentName string) map[string]string
- func GetRestoredInitContainerName(backupName string) string
- func PatchBuiltInToleration(tolerations []corev1.Toleration) []corev1.Toleration
- func ReplaceNamedVars(namedValuesMap map[string]string, targetVar string, limits int, matchAll bool) string
- func ReplaceSecretEnvVars(namedValuesMap map[string]string, envs []corev1.EnvVar) []corev1.EnvVar
- type MonitorConfig
- type SynthesizedComponent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildRestoredInfo ¶
func BuildRestoredInfo( reqCtx intctrlutil.RequestCtx, cli client.Client, namespace string, component *SynthesizedComponent, backupName string) error
BuildRestoredInfo builds restore-related infos if it needs to restore from backup, such as init container/pvc dataSource.
func BuildRestoredInfo2 ¶
func BuildRestoredInfo2( component *SynthesizedComponent, backup *dataprotectionv1alpha1.Backup, backupTool *dataprotectionv1alpha1.BackupTool) error
BuildRestoredInfo2 builds restore-related infos if it needs to restore from backup, such as init container/pvc dataSource.
func GenerateConnCredential ¶
func GetClusterDefCompByName ¶
func GetClusterDefCompByName(clusterDef appsv1alpha1.ClusterDefinition, cluster appsv1alpha1.Cluster, compName string) *appsv1alpha1.ClusterComponentDefinition
func GetEnvReplacementMapForConnCredential ¶
GetEnvReplacementMapForConnCredential gets the replacement map for connect credential
func GetReplacementMapForBuiltInEnv ¶
func GetReplacementMapForBuiltInEnv(cluster *appsv1alpha1.Cluster, componentName string) map[string]string
GetReplacementMapForBuiltInEnv gets the replacement map for KubeBlocks built-in environment variables.
func GetRestoredInitContainerName ¶
GetRestoredInitContainerName gets the init container name for restore.
func PatchBuiltInToleration ¶
func PatchBuiltInToleration(tolerations []corev1.Toleration) []corev1.Toleration
PatchBuiltInToleration patches built-in tolerations configuration
Types ¶
type MonitorConfig ¶
type SynthesizedComponent ¶
type SynthesizedComponent struct { ClusterDefName string `json:"clusterDefName,omitempty"` Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` CharacterType string `json:"characterType,omitempty"` Replicas int32 `json:"replicas"` WorkloadType v1alpha1.WorkloadType `json:"workloadType,omitempty"` ConsensusSpec *v1alpha1.ConsensusSetSpec `json:"consensusSpec,omitempty"` PrimaryIndex *int32 `json:"primaryIndex,omitempty"` PodSpec *corev1.PodSpec `json:"podSpec,omitempty"` Services []corev1.Service `json:"services,omitempty"` Probes *v1alpha1.ClusterDefinitionProbes `json:"probes,omitempty"` VolumeClaimTemplates []corev1.PersistentVolumeClaimTemplate `json:"volumeClaimTemplates,omitempty"` Monitor *MonitorConfig `json:"monitor,omitempty"` EnabledLogs []string `json:"enabledLogs,omitempty"` LogConfigs []v1alpha1.LogConfig `json:"logConfigs,omitempty"` ConfigTemplates []v1alpha1.ComponentConfigSpec `json:"configTemplates,omitempty"` ScriptTemplates []v1alpha1.ComponentTemplateSpec `json:"scriptTemplates,omitempty"` HorizontalScalePolicy *v1alpha1.HorizontalScalePolicy `json:"horizontalScalePolicy,omitempty"` TLS bool `json:"tls"` Issuer *v1alpha1.Issuer `json:"issuer,omitempty"` VolumeTypes []v1alpha1.VolumeTypeSpec `json:"VolumeTypes,omitempty"` CustomLabelSpecs []v1alpha1.CustomLabelSpec `json:"customLabelSpecs,omitempty"` ComponentDef string `json:"componentDef,omitempty"` ServiceAccountName string `json:"serviceAccountName,omitempty"` }
func BuildComponent ¶
func BuildComponent( reqCtx intctrlutil.RequestCtx, cluster appsv1alpha1.Cluster, classes map[string]map[string]*appsv1alpha1.ComponentClassInstance, clusterDef appsv1alpha1.ClusterDefinition, clusterCompDef appsv1alpha1.ClusterComponentDefinition, clusterCompSpec appsv1alpha1.ClusterComponentSpec, clusterCompVers ...*appsv1alpha1.ClusterComponentVersion, ) (*SynthesizedComponent, error)
BuildComponent generates a new Component object, which is a mixture of component-related configs from input Cluster, ClusterDef and ClusterVersion.
func (*SynthesizedComponent) GetPrimaryIndex ¶
func (r *SynthesizedComponent) GetPrimaryIndex() int32
GetPrimaryIndex provides PrimaryIndex value getter, if PrimaryIndex is a nil pointer it's treated at 0, return -1 if function receiver is nil.