Documentation ¶
Index ¶
- func BuiltInCustomFunctions(c *configTemplateBuilder, component *component.SynthesizedComponent, ...) *gotemplate.BuiltInObjectsFunc
- func CheckTLSSecretRef(ctx context.Context, cli client2.ReadonlyClient, namespace string, ...) error
- func ComposeTLSSecret(namespace, clusterName, componentName string) (*v1.Secret, error)
- func DoPITR(ctx context.Context, cli client.Client, cluster *appsv1alpha1.Cluster, ...) error
- func DoRestore(ctx context.Context, cli client.Client, cluster *appsv1alpha1.Cluster, ...) error
- func GenServiceReferences(reqCtx intctrlutil.RequestCtx, cli client.Client, ...) (map[string]*appsv1alpha1.ServiceDescriptor, error)
- func GenerateTLSSecretName(clusterName, componentName string) string
- func GetTLSKeyWord(cType string) string
- func RenderConfigNScriptFiles(clusterVersion *appsv1alpha1.ClusterVersion, cluster *appsv1alpha1.Cluster, ...) error
- func SyncEnvConfigmap(configSpec appsv1alpha1.ComponentConfigSpec, cmObj *corev1.ConfigMap, ...) error
- type ComponentVisitor
- type DecoratedVisitor
- type ResourceDefinition
- type RestoreManager
- func (p *RestoreManager) BuildDatafileRestoreJob(synthesizedComponent *component.SynthesizedComponent, ...) (objs []client.Object, err error)
- func (p *RestoreManager) BuildDatafileRestoreJobByPVCS(synthesizedComponent *component.SynthesizedComponent, ...) (objs []client.Object, err error)
- func (p *RestoreManager) GetDatafileRestoreJobName(pvcName string) string
- type TemplateMerger
- type Visitor
- type VisitorFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuiltInCustomFunctions ¶
func BuiltInCustomFunctions(c *configTemplateBuilder, component *component.SynthesizedComponent, localObjs []client.Object) *gotemplate.BuiltInObjectsFunc
BuiltInCustomFunctions builds a map of customized functions for KubeBlocks
func CheckTLSSecretRef ¶
func CheckTLSSecretRef(ctx context.Context, cli client2.ReadonlyClient, namespace string, secretRef *dbaasv1alpha1.TLSSecretRef) error
func ComposeTLSSecret ¶
ComposeTLSSecret composes a TSL secret object. REVIEW/TODO:
- missing public function doc
- should avoid using Go template to call a function, this is too hacky & costly, should just call underlying registered Go template function.
func DoPITR ¶ added in v0.6.0
func DoPITR(ctx context.Context, cli client.Client, cluster *appsv1alpha1.Cluster, component *component.SynthesizedComponent, schema *k8sruntime.Scheme) error
DoPITR prepares PITR jobs
func DoRestore ¶ added in v0.6.0
func DoRestore(ctx context.Context, cli client.Client, cluster *appsv1alpha1.Cluster, component *component.SynthesizedComponent, schema *k8sruntime.Scheme) error
DoRestore prepares restore jobs
func GenServiceReferences ¶
func GenServiceReferences(reqCtx intctrlutil.RequestCtx, cli client.Client, cluster *appsv1alpha1.Cluster, clusterCompDef *appsv1alpha1.ClusterComponentDefinition, clusterCompSpec *appsv1alpha1.ClusterComponentSpec, ) (map[string]*appsv1alpha1.ServiceDescriptor, error)
func GenerateTLSSecretName ¶
func GetTLSKeyWord ¶
func RenderConfigNScriptFiles ¶ added in v0.6.0
func RenderConfigNScriptFiles(clusterVersion *appsv1alpha1.ClusterVersion, cluster *appsv1alpha1.Cluster, component *component.SynthesizedComponent, obj client.Object, podSpec *corev1.PodSpec, localObjs []client.Object, ctx context.Context, cli client.Client) error
RenderConfigNScriptFiles generates volumes for PodTemplate, volumeMount for container, rendered configTemplate and scriptTemplate, and generates configManager sidecar for the reconfigure operation. TODO rename this function, this function name is not very reasonable, but there is no suitable name.
func SyncEnvConfigmap ¶ added in v0.6.0
func SyncEnvConfigmap(configSpec appsv1alpha1.ComponentConfigSpec, cmObj *corev1.ConfigMap, cc *appsv1alpha1.ConfigConstraintSpec, cli client.Client, ctx context.Context) error
Types ¶
type ComponentVisitor ¶
type ComponentVisitor struct {
// contains filtered or unexported fields
}
ComponentVisitor implements Visitor, it will visit the component.SynthesizedComponent
func (*ComponentVisitor) Visit ¶
func (r *ComponentVisitor) Visit(fn VisitorFunc) error
Visit implements Visitor
type DecoratedVisitor ¶
type DecoratedVisitor struct {
// contains filtered or unexported fields
}
DecoratedVisitor will invoke the decorators in order prior to invoking the visitor function passed to Visit. An error will terminate the visit.
func (DecoratedVisitor) Visit ¶
func (v DecoratedVisitor) Visit(fn VisitorFunc) error
Visit implements Visitor
type ResourceDefinition ¶
type RestoreManager ¶ added in v0.6.0
type RestoreManager struct { client.Client Ctx context.Context Cluster *appsv1alpha1.Cluster Scheme *k8sruntime.Scheme // contains filtered or unexported fields }
RestoreManager restores manager functions 1. support datafile/snapshot restore 2. support point in time recovery (PITR)
func NewRestoreManager ¶ added in v0.6.0
func NewRestoreManager(ctx context.Context, cli client.Client, cluster *appsv1alpha1.Cluster, scheme *k8sruntime.Scheme) *RestoreManager
func (*RestoreManager) BuildDatafileRestoreJob ¶ added in v0.6.0
func (p *RestoreManager) BuildDatafileRestoreJob(synthesizedComponent *component.SynthesizedComponent, backup *dpv1alpha1.Backup, backupTool *dpv1alpha1.BackupTool) (objs []client.Object, err error)
func (*RestoreManager) BuildDatafileRestoreJobByPVCS ¶ added in v0.6.0
func (p *RestoreManager) BuildDatafileRestoreJobByPVCS(synthesizedComponent *component.SynthesizedComponent, backup *dpv1alpha1.Backup, backupTool *dpv1alpha1.BackupTool, pvcNames []string, labels map[string]string) (objs []client.Object, err error)
func (*RestoreManager) GetDatafileRestoreJobName ¶ added in v0.6.0
func (p *RestoreManager) GetDatafileRestoreJobName(pvcName string) string
type TemplateMerger ¶ added in v0.6.0
type TemplateMerger interface { // Merge merges the baseData with the data from the template. Merge(baseData map[string]string, updatedData map[string]string) (map[string]string, error) // contains filtered or unexported methods }
func NewTemplateMerger ¶ added in v0.6.0
func NewTemplateMerger(template appsv1alpha1.LazyRenderedTemplateSpec, ctx context.Context, cli client.Client, builder *configTemplateBuilder, configSpec appsv1alpha1.ComponentConfigSpec, ccSpec *appsv1alpha1.ConfigConstraintSpec) (TemplateMerger, error)
type Visitor ¶
type Visitor interface {
Visit(VisitorFunc) error
}
func NewDecoratedVisitor ¶
func NewDecoratedVisitor(v Visitor, fn ...VisitorFunc) Visitor
NewDecoratedVisitor will create a visitor that invokes the provided visitor functions before the user supplied visitor function is invoked, giving them the opportunity to mutate the Info object or terminate early with an error.
type VisitorFunc ¶
type VisitorFunc func(*component.SynthesizedComponent, error) error