configuration

package
v0.5.3-beta.5 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: AGPL-3.0 Imports: 40 Imported by: 2

Documentation

Index

Constants

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

Variables

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 GetClientFactory

func GetClientFactory() createReconfigureClient

GetClientFactory support ut mock

func GetComponentPods

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

GetComponentPods get all pods of the component.

func NeedReloadVolume

func NeedReloadVolume(config appsv1alpha1.ComponentConfigSpec) bool

func NewReconfigurePolicy

func NewReconfigurePolicy(cc *appsv1alpha1.ConfigConstraintSpec, cfgPatch *cfgcore.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 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. ESAndRetryFailed 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"
	ESAndRetryFailed 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 ReconfigureRequestReconciler

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

ReconfigureRequestReconciler reconciles a ReconfigureRequest object

func (*ReconfigureRequestReconciler) 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 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 (*ReconfigureRequestReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

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
}

func GetConsensusRollingUpgradeFuncs

func GetConsensusRollingUpgradeFuncs() RollingUpgradeFuncs

func GetDeploymentRollingUpgradeFuncs

func GetDeploymentRollingUpgradeFuncs() RollingUpgradeFuncs

func GetReplicationRollingUpgradeFuncs

func GetReplicationRollingUpgradeFuncs() RollingUpgradeFuncs

func GetStatefulSetRollingUpgradeFuncs

func GetStatefulSetRollingUpgradeFuncs() RollingUpgradeFuncs

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