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: 45 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ConfigReconcileInterval = time.Second * 1
)

Variables

This section is empty.

Functions

func CheckReconfigureUpdateProgress

func CheckReconfigureUpdateProgress(pods []corev1.Pod, configKey, version string) int32

CheckReconfigureUpdateProgress checks pods of the component is ready.

func DeleteConfigMapFinalizer

func DeleteConfigMapFinalizer(cli client.Client, ctx intctrlutil.RequestCtx, obj client.Object) error

func GcConfigRevision added in v0.7.0

func GcConfigRevision(configObj *corev1.ConfigMap)

func GetClientFactory

func GetClientFactory() createReconfigureClient

GetClientFactory support ut mock

func GetComponentPods

func GetComponentPods(params reconfigureParams) ([]corev1.Pod, error)

GetComponentPods gets all pods of the component.

func GetCurrentRevision added in v0.7.0

func GetCurrentRevision(annotations map[string]string) string

func NewReconfigurePolicy

func NewReconfigurePolicy(cc *appsv1alpha1.ConfigConstraintSpec, cfgPatch *core.ConfigPatchInfo, policy appsv1alpha1.UpgradePolicy, restart bool) (reconfigurePolicy, error)

func ReconcileConfigSpecsForReferencedCR

func ReconcileConfigSpecsForReferencedCR[T generics.Object, PT generics.PObject[T]](client client.Client, ctx intctrlutil.RequestCtx, obj PT) error

func RegisterPolicy

func RegisterPolicy(policy appsv1alpha1.UpgradePolicy, action reconfigurePolicy)

Types

type AutoReloadPolicy

type AutoReloadPolicy struct{}

func (AutoReloadPolicy) GetPolicyName

func (receiver AutoReloadPolicy) GetPolicyName() string

func (AutoReloadPolicy) Upgrade

func (receiver AutoReloadPolicy) Upgrade(params reconfigureParams) (ReturnedStatus, error)

type ComponentValidateHandler

type ComponentValidateHandler func(component *appsv1alpha1.ClusterComponentDefinition) error

type ConfigConstraintReconciler

type ConfigConstraintReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
}

ConfigConstraintReconciler reconciles a ConfigConstraint object

func (*ConfigConstraintReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the ConfigConstraint object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.11.2/pkg/reconcile

func (*ConfigConstraintReconciler) SetupWithManager

func (r *ConfigConstraintReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type ConfigTemplateHandler

type ConfigTemplateHandler func([]appsv1alpha1.ComponentConfigSpec) (bool, error)

type ConfigurationReconciler added in v0.7.0

type ConfigurationReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
}

ConfigurationReconciler reconciles a Configuration object

func (*ConfigurationReconciler) Reconcile added in v0.7.0

func (r *ConfigurationReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the Configuration object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.4/pkg/reconcile

func (*ConfigurationReconciler) SetupWithManager added in v0.7.0

func (r *ConfigurationReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type ConfigurationRevision added in v0.7.0

type ConfigurationRevision struct {
	Revision    int64
	StrRevision string
	Phase       appsv1alpha1.ConfigurationPhase
	Result      intctrlutil.Result
}

func GcRevision added in v0.7.0

func GcRevision(annotations map[string]string) []ConfigurationRevision

func GetLastRevision added in v0.7.0

func GetLastRevision(annotations map[string]string, revision int64) (ConfigurationRevision, bool)

func RetrieveRevision added in v0.7.0

func RetrieveRevision(annotations map[string]string) []ConfigurationRevision

type ExecStatus

type ExecStatus string

ExecStatus defines running result for Reconfiguring policy (fsm). ESNone describes policy has finished and quit. ESRetry describes fsm is running. ESFailed describes fsm is failed and exited. ESNotSupport describes fsm does not support the feature. ESFailedAndRetry describes fsm is failed in current state, but can be retried. +enum

const (
	ESNone           ExecStatus = "None"
	ESRetry          ExecStatus = "Retry"
	ESFailed         ExecStatus = "Failed"
	ESNotSupport     ExecStatus = "NotSupport"
	ESFailedAndRetry ExecStatus = "FailedAndRetry"
)

type GetPodsFunc

type GetPodsFunc func(params reconfigureParams) ([]corev1.Pod, error)

type OnlineUpdatePodFunc

type OnlineUpdatePodFunc func(pod *corev1.Pod, ctx context.Context, createClient createReconfigureClient, configSpec string, updatedParams map[string]string) error

type ReconfigureReconciler added in v0.7.0

type ReconfigureReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
}

ReconfigureReconciler reconciles a ReconfigureRequest object

func (*ReconfigureReconciler) Reconcile added in v0.7.0

func (r *ReconfigureReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the ReconfigureRequest object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.11.2/pkg/reconcile

func (*ReconfigureReconciler) SetupWithManager added in v0.7.0

func (r *ReconfigureReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type RestartComponent added in v0.6.0

type RestartComponent func(client client.Client, ctx intctrlutil.RequestCtx, key string, version string, objs []client.Object, recordEvent func(obj client.Object)) (client.Object, error)

type RestartContainerFunc

type RestartContainerFunc func(pod *corev1.Pod, ctx context.Context, containerName []string, createConnFn createReconfigureClient) error

type ReturnedStatus

type ReturnedStatus struct {
	Status        ExecStatus
	SucceedCount  int32
	ExpectedCount int32
}

type RollingUpgradeFuncs

type RollingUpgradeFuncs struct {
	GetPodsFunc          GetPodsFunc
	RestartContainerFunc RestartContainerFunc
	OnlineUpdatePodFunc  OnlineUpdatePodFunc
	RestartComponent     RestartComponent
}

func GetRSMRollingUpgradeFuncs added in v0.8.0

func GetRSMRollingUpgradeFuncs() RollingUpgradeFuncs

type Task added in v0.7.0

type Task struct {
	configctrl.ResourceFetcher[Task]

	Status *appsv1alpha1.ConfigurationItemDetailStatus
	Name   string

	Do func(fetcher *Task, component *component.SynthesizedComponent, dependOnObjs []client.Object, revision string) error
}

type TaskContext added in v0.7.0

type TaskContext struct {
	// contains filtered or unexported fields
}

type ValidateConfigMap

type ValidateConfigMap func(configTpl, ns string) (*corev1.ConfigMap, error)

type ValidateConfigSchema

type ValidateConfigSchema func(tpl *appsv1alpha1.CustomParametersValidation) (bool, error)

Jump to

Keyboard shortcuts

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