Documentation ¶
Index ¶
- Constants
- func CheckReconfigureUpdateProgress(pods []corev1.Pod, configKey, version string) int32
- func DeleteConfigMapFinalizer(cli client.Client, ctx intctrlutil.RequestCtx, obj client.Object) error
- func GcConfigRevision(configObj *corev1.ConfigMap)
- func GetClientFactory() createReconfigureClient
- func GetComponentPods(params reconfigureParams) ([]corev1.Pod, error)
- func GetCurrentRevision(annotations map[string]string) string
- func NewReconfigurePolicy(cc *appsv1beta1.ConfigConstraintSpec, cfgPatch *core.ConfigPatchInfo, ...) (reconfigurePolicy, error)
- func ReconcileConfigSpecsForReferencedCR[T generics.Object, PT generics.PObject[T]](client client.Client, ctx intctrlutil.RequestCtx, obj PT) error
- func RegisterPolicy(policy appsv1alpha1.UpgradePolicy, action reconfigurePolicy)
- type AutoReloadPolicy
- type ComponentValidateHandler
- type ConfigConstraintReconciler
- type ConfigTemplateHandler
- type ConfigurationReconciler
- type ConfigurationRevision
- type ExecStatus
- type GetPodsFunc
- type OnlineUpdatePodFunc
- type ReconfigureReconciler
- type RestartComponent
- type RestartContainerFunc
- type ReturnedStatus
- type RollingUpgradeFuncs
- type Task
- type TaskContext
- type ValidateConfigMap
- type ValidateConfigSchema
Constants ¶
const (
ConfigReconcileInterval = time.Second * 1
)
Variables ¶
This section is empty.
Functions ¶
func CheckReconfigureUpdateProgress ¶
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 GetClientFactory ¶
func GetClientFactory() createReconfigureClient
GetClientFactory support ut mock
func GetComponentPods ¶
GetComponentPods gets all pods of the component.
func GetCurrentRevision ¶ added in v0.7.0
func NewReconfigurePolicy ¶
func NewReconfigurePolicy(cc *appsv1beta1.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 ¶
func (r *ConfigConstraintReconciler) 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 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, multiClusterMgr multicluster.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 OnlineUpdatePodFunc ¶
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, multiClusterMgr multicluster.Manager) error
SetupWithManager sets up the controller with the Manager.
type RestartComponent ¶ added in v0.6.0
type RestartContainerFunc ¶
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 }
func NewTask ¶ added in v0.7.0
func NewTask(item appsv1alpha1.ConfigurationItemDetail, status *appsv1alpha1.ConfigurationItemDetailStatus) Task
type TaskContext ¶ added in v0.7.0
type TaskContext struct {
// contains filtered or unexported fields
}
type ValidateConfigMap ¶
type ValidateConfigSchema ¶
type ValidateConfigSchema func(tpl *appsv1beta1.ConfigSchema) (bool, error)
Source Files ¶
- combine_upgrade_policy.go
- config_annotation.go
- config_reconcile_wrapper.go
- config_related_helper.go
- config_util.go
- configconstraint_controller.go
- configuration_controller.go
- parallel_upgrade_policy.go
- policy_util.go
- reconcile_task.go
- reconfigure_controller.go
- reconfigure_policy.go
- relatedresource.go
- revision.go
- rolling_upgrade_policy.go
- simple_policy.go
- sync_upgrade_policy.go
- types.go
- utils.go