configuration

package
v0.8.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2024 License: AGPL-3.0 Imports: 32 Imported by: 1

Documentation

Index

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 CheckAndUpdateItemStatus

func CheckAndUpdateItemStatus(updated *appsv1alpha1.Configuration, item appsv1alpha1.ConfigurationItemDetail, reversion string)

func CheckEnvFrom

func CheckEnvFrom(container *corev1.Container, cmName string) bool

func GetConfigManagerGRPCPort added in v0.8.0

func GetConfigManagerGRPCPort(containers []corev1.Container) (int32, error)

func NewConfigReconcileTask

func NewConfigReconcileTask(resourceCtx *ResourceCtx,
	cluster *appsv1alpha1.Cluster,
	component *component.SynthesizedComponent,
	podSpec *corev1.PodSpec,
	localObjs []client.Object,
) *configOperator

func NewCreatePipeline

func NewCreatePipeline(ctx ReconcileCtx) *pipeline

func NewReconcilePipeline

func NewReconcilePipeline(ctx ReconcileCtx, item appsv1alpha1.ConfigurationItemDetail, itemStatus *appsv1alpha1.ConfigurationItemDetailStatus, configSpec *appsv1alpha1.ComponentConfigSpec) *updatePipeline

func UpdateCMConfigSpecLabels

func UpdateCMConfigSpecLabels(cm *corev1.ConfigMap, configSpec appsv1alpha1.ComponentConfigSpec)

Types

type DynamicComponentInfo added in v0.8.0

type DynamicComponentInfo struct {
	Name       string             `json:"name"`
	Containers []corev1.Container `json:"containers,omitempty"`
}

DynamicComponentInfo records information dynamically generated by component controller

type Fetcher added in v0.8.2

type Fetcher struct {
	ResourceFetcher[Fetcher]
}

func NewResourceFetcher added in v0.8.2

func NewResourceFetcher(resourceCtx *ResourceCtx) *Fetcher

type ReconcileCtx

type ReconcileCtx struct {
	*ResourceCtx

	Cluster   *appsv1alpha1.Cluster
	Component *component.SynthesizedComponent
	PodSpec   *corev1.PodSpec

	Cache []client.Object
}

type ResourceCtx added in v0.8.2

type ResourceCtx struct {
	context.Context

	Err    error
	Client client.Client

	Namespace     string
	ClusterName   string
	ComponentName string
}

type ResourceDefinition

type ResourceDefinition struct {
	MemorySize int64 `json:"memorySize,omitempty"`
	CoreNum    int64 `json:"coreNum,omitempty"`
}

type ResourceFetcher added in v0.8.2

type ResourceFetcher[T any] struct {
	*ResourceCtx

	ClusterObj *appsv1alpha1.Cluster
	// Deprecated: this API will be removed from version 0.9.0
	ClusterDefObj *appsv1alpha1.ClusterDefinition
	// Deprecated: use ComponentDefinition instead
	ClusterVerObj *appsv1alpha1.ClusterVersion

	ConfigMapObj        *corev1.ConfigMap
	ConfigurationObj    *appsv1alpha1.Configuration
	ConfigConstraintObj *appsv1alpha1.ConfigConstraint

	ClusterComObj *appsv1alpha1.ClusterComponentSpec
	// contains filtered or unexported fields
}

func (*ResourceFetcher[T]) Cluster added in v0.8.2

func (r *ResourceFetcher[T]) Cluster() *T

func (*ResourceFetcher[T]) ClusterComponent added in v0.8.2

func (r *ResourceFetcher[T]) ClusterComponent() *T

func (*ResourceFetcher[T]) ClusterDef added in v0.8.2

func (r *ResourceFetcher[T]) ClusterDef() *T

ClusterDef get clusterDefinition cr Deprecated: use ComponentDefinition instead

func (*ResourceFetcher[T]) ClusterVer added in v0.8.2

func (r *ResourceFetcher[T]) ClusterVer() *T

ClusterVer get clusterVersion cr Deprecated: this API will be removed from version 0.9.0

func (*ResourceFetcher[T]) Complete added in v0.8.2

func (r *ResourceFetcher[T]) Complete() error

func (*ResourceFetcher[T]) ConfigConstraints added in v0.8.2

func (r *ResourceFetcher[T]) ConfigConstraints(ccName string) *T

func (*ResourceFetcher[T]) ConfigMap added in v0.8.2

func (r *ResourceFetcher[T]) ConfigMap(configSpec string) *T

func (*ResourceFetcher[T]) Configuration added in v0.8.2

func (r *ResourceFetcher[T]) Configuration() *T

func (*ResourceFetcher[T]) Init added in v0.8.2

func (r *ResourceFetcher[T]) Init(ctx *ResourceCtx, object *T) *T

func (*ResourceFetcher[T]) Wrap added in v0.8.2

func (r *ResourceFetcher[T]) Wrap(fn func() error) (ret *T)

type TemplateMerger

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

func NewTemplateMerger(template appsv1alpha1.ConfigTemplateExtension, ctx context.Context, cli client.Client, builder *configTemplateBuilder, configSpec appsv1alpha1.ComponentConfigSpec, ccSpec *appsv1alpha1.ConfigConstraintSpec) (TemplateMerger, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL