parameters

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2025 License: AGPL-3.0 Imports: 58 Imported by: 0

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 GcConfigRevision

func GcConfigRevision(configObj *corev1.ConfigMap)

func GetClientFactory

func GetClientFactory() createReconfigureClient

GetClientFactory support ut mock

func GetComponentPods

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

GetComponentPods gets all pods of the component.

func GetCurrentRevision

func GetCurrentRevision(annotations map[string]string) string

Types

type AutoReloadPolicy

type AutoReloadPolicy struct{}

func (AutoReloadPolicy) GetPolicyName

func (receiver AutoReloadPolicy) GetPolicyName() string

func (AutoReloadPolicy) Upgrade

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

type ComponentDrivenParameterReconciler

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

ComponentDrivenParameterReconciler reconciles a Parameter object

func (*ComponentDrivenParameterReconciler) 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.

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

func (*ComponentDrivenParameterReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type ComponentParameterReconciler

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

ComponentParameterReconciler reconciles a ComponentParameter object

func (*ComponentParameterReconciler) 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.

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

func (*ComponentParameterReconciler) SetupWithManager

func (r *ComponentParameterReconciler) SetupWithManager(mgr ctrl.Manager, multiClusterMgr multicluster.Manager) error

SetupWithManager sets up the controller with the Manager.

type ConfigurationRevision

type ConfigurationRevision struct {
	Revision    int64
	StrRevision string
	Phase       parametersv1alpha1.ParameterPhase
	Result      intctrlutil.Result
}

func GcRevision

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

func GetLastRevision

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

func RetrieveRevision

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 reconfigureContext) ([]corev1.Pod, error)

type OnlineUpdatePodFunc

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

type ParameterDrivenConfigRenderReconciler

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

ParameterDrivenConfigRenderReconciler reconciles a ParamConfigRenderer object

func (*ParameterDrivenConfigRenderReconciler) 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.

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

func (*ParameterDrivenConfigRenderReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type ParameterReconciler

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

ParameterReconciler reconciles a Parameter object

func (*ParameterReconciler) Reconcile

func (r *ParameterReconciler) 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.

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

func (*ParameterReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type ParameterTemplateExtensionReconciler

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

ParameterTemplateExtensionReconciler reconciles a ParameterTemplateExtension object

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

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

SetupWithManager sets up the controller with the Manager.

type ParametersDefinitionReconciler

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

ParametersDefinitionReconciler reconciles a ParametersDefinition object

func (*ParametersDefinitionReconciler) 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.

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

func (*ParametersDefinitionReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type ReconcileContext

type ReconcileContext struct {
	intctrlutil.RequestCtx
	configctrl.ResourceFetcher[ReconcileContext]

	Name             string
	MatchingLabels   client.MatchingLabels
	ConfigMap        *corev1.ConfigMap
	BuiltinComponent *component.SynthesizedComponent

	Containers      []string
	InstanceSetList []workloads.InstanceSet

	ConfigRender   *parametersv1alpha1.ParamConfigRenderer
	ParametersDefs map[string]*parametersv1alpha1.ParametersDefinition
}

func (*ReconcileContext) GetRelatedObjects

func (c *ReconcileContext) GetRelatedObjects() error

func (*ReconcileContext) ParametersDefinitions

func (c *ReconcileContext) ParametersDefinitions() *ReconcileContext

func (*ReconcileContext) SynthesizedComponent

func (c *ReconcileContext) SynthesizedComponent() *ReconcileContext

func (*ReconcileContext) Workload

func (c *ReconcileContext) Workload() *ReconcileContext

type ReconfigureReconciler

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

ReconfigureReconciler reconciles a ReconfigureRequest object

func (*ReconfigureReconciler) Reconcile

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

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

SetupWithManager sets up the controller with the Manager.

type ReloadAction

type ReloadAction interface {
	ExecReload() (ReturnedStatus, error)
	ReloadType() string
}

type RestartComponent

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 GetInstanceSetRollingUpgradeFuncs

func GetInstanceSetRollingUpgradeFuncs() RollingUpgradeFuncs

type TaskContext

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

func NewTaskContext

func NewTaskContext(ctx context.Context, cli client.Client, componentParameter *parametersv1alpha1.ComponentParameter, fetchTask *Task) (*TaskContext, error)

Jump to

Keyboard shortcuts

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