Documentation ¶
Index ¶
- type ComponentBase
- func (c *ComponentBase) AddResource(obj client.Object, action *ictrltypes.LifecycleAction, ...) *ictrltypes.LifecycleVertex
- func (c *ComponentBase) CreateResource(obj client.Object, parent *ictrltypes.LifecycleVertex) *ictrltypes.LifecycleVertex
- func (c *ComponentBase) DeleteResource(obj client.Object, parent *ictrltypes.LifecycleVertex) *ictrltypes.LifecycleVertex
- func (c *ComponentBase) GetCluster() *appsv1alpha1.Cluster
- func (c *ComponentBase) GetClusterName() string
- func (c *ComponentBase) GetClusterVersion() *appsv1alpha1.ClusterVersion
- func (c *ComponentBase) GetConsensusSpec() *appsv1alpha1.ConsensusSetSpec
- func (c *ComponentBase) GetDefinitionName() string
- func (c *ComponentBase) GetMatchingLabels() client.MatchingLabels
- func (c *ComponentBase) GetName() string
- func (c *ComponentBase) GetNamespace() string
- func (c *ComponentBase) GetPhase() appsv1alpha1.ClusterComponentPhase
- func (c *ComponentBase) GetPrimaryIndex() int32
- func (c *ComponentBase) GetReplicas() int32
- func (c *ComponentBase) GetSynthesizedComponent() *component.SynthesizedComponent
- func (c *ComponentBase) NoopResource(obj client.Object, parent *ictrltypes.LifecycleVertex) *ictrltypes.LifecycleVertex
- func (c *ComponentBase) PatchResource(obj client.Object, objCopy client.Object, parent *ictrltypes.LifecycleVertex) *ictrltypes.LifecycleVertex
- func (c *ComponentBase) ResolveObjectsAction(reqCtx intctrlutil.RequestCtx, cli client.Client) error
- func (c *ComponentBase) SetStatusPhase(phase appsv1alpha1.ClusterComponentPhase, ...)
- func (c *ComponentBase) SetWorkload(obj client.Object, action *ictrltypes.LifecycleAction, ...)
- func (c *ComponentBase) StatusWorkload(reqCtx intctrlutil.RequestCtx, cli client.Client, obj client.Object, ...) error
- func (c *ComponentBase) UpdatePDB(reqCtx intctrlutil.RequestCtx, cli client.Client) error
- func (c *ComponentBase) UpdateResource(obj client.Object, parent *ictrltypes.LifecycleVertex) *ictrltypes.LifecycleVertex
- func (c *ComponentBase) UpdateService(reqCtx intctrlutil.RequestCtx, cli client.Client) error
- func (c *ComponentBase) ValidateObjectsAction() error
- type ComponentWorkloadBuilder
- type ComponentWorkloadBuilderBase
- func (b *ComponentWorkloadBuilderBase) BuildConfig() ComponentWorkloadBuilder
- func (b *ComponentWorkloadBuilderBase) BuildEnv() ComponentWorkloadBuilder
- func (b *ComponentWorkloadBuilderBase) BuildHeadlessService() ComponentWorkloadBuilder
- func (b *ComponentWorkloadBuilderBase) BuildPDB() ComponentWorkloadBuilder
- func (b *ComponentWorkloadBuilderBase) BuildService() ComponentWorkloadBuilder
- func (b *ComponentWorkloadBuilderBase) BuildTLSCert() ComponentWorkloadBuilder
- func (b *ComponentWorkloadBuilderBase) BuildTLSVolume() ComponentWorkloadBuilder
- func (b *ComponentWorkloadBuilderBase) BuildVolumeMount() ComponentWorkloadBuilder
- func (b *ComponentWorkloadBuilderBase) BuildWorkload4StatefulSet(workloadType string) ComponentWorkloadBuilder
- func (b *ComponentWorkloadBuilderBase) BuildWrapper(buildfn func() ([]client.Object, error)) ComponentWorkloadBuilder
- func (b *ComponentWorkloadBuilderBase) Complete() error
- type StatefulComponentBase
- func (c *StatefulComponentBase) Create(reqCtx intctrlutil.RequestCtx, cli client.Client, ...) error
- func (c *StatefulComponentBase) Delete(reqCtx intctrlutil.RequestCtx, cli client.Client) error
- func (c *StatefulComponentBase) ExpandVolume(reqCtx intctrlutil.RequestCtx, cli client.Client) error
- func (c *StatefulComponentBase) GetBuiltObjects(builder ComponentWorkloadBuilder) ([]client.Object, error)
- func (c *StatefulComponentBase) HorizontalScale(reqCtx intctrlutil.RequestCtx, cli client.Client) error
- func (c *StatefulComponentBase) Restart(reqCtx intctrlutil.RequestCtx, cli client.Client) error
- func (c *StatefulComponentBase) Status(reqCtx intctrlutil.RequestCtx, cli client.Client, ...) error
- func (c *StatefulComponentBase) Update(reqCtx intctrlutil.RequestCtx, cli client.Client, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComponentBase ¶
type ComponentBase struct { Client client.Client Recorder record.EventRecorder Cluster *appsv1alpha1.Cluster ClusterVersion *appsv1alpha1.ClusterVersion // building config needs the cluster version Component *component.SynthesizedComponent // built synthesized component, replace it with component workload proto ComponentSet types.ComponentSet Dag *graph.DAG WorkloadVertex *ictrltypes.LifecycleVertex // DAG vertex of main workload object }
func (*ComponentBase) AddResource ¶
func (c *ComponentBase) AddResource(obj client.Object, action *ictrltypes.LifecycleAction, parent *ictrltypes.LifecycleVertex) *ictrltypes.LifecycleVertex
func (*ComponentBase) CreateResource ¶
func (c *ComponentBase) CreateResource(obj client.Object, parent *ictrltypes.LifecycleVertex) *ictrltypes.LifecycleVertex
func (*ComponentBase) DeleteResource ¶
func (c *ComponentBase) DeleteResource(obj client.Object, parent *ictrltypes.LifecycleVertex) *ictrltypes.LifecycleVertex
func (*ComponentBase) GetCluster ¶
func (c *ComponentBase) GetCluster() *appsv1alpha1.Cluster
func (*ComponentBase) GetClusterName ¶
func (c *ComponentBase) GetClusterName() string
func (*ComponentBase) GetClusterVersion ¶
func (c *ComponentBase) GetClusterVersion() *appsv1alpha1.ClusterVersion
func (*ComponentBase) GetConsensusSpec ¶
func (c *ComponentBase) GetConsensusSpec() *appsv1alpha1.ConsensusSetSpec
func (*ComponentBase) GetDefinitionName ¶
func (c *ComponentBase) GetDefinitionName() string
func (*ComponentBase) GetMatchingLabels ¶
func (c *ComponentBase) GetMatchingLabels() client.MatchingLabels
func (*ComponentBase) GetName ¶
func (c *ComponentBase) GetName() string
func (*ComponentBase) GetNamespace ¶
func (c *ComponentBase) GetNamespace() string
func (*ComponentBase) GetPhase ¶
func (c *ComponentBase) GetPhase() appsv1alpha1.ClusterComponentPhase
func (*ComponentBase) GetPrimaryIndex ¶
func (c *ComponentBase) GetPrimaryIndex() int32
func (*ComponentBase) GetReplicas ¶
func (c *ComponentBase) GetReplicas() int32
func (*ComponentBase) GetSynthesizedComponent ¶
func (c *ComponentBase) GetSynthesizedComponent() *component.SynthesizedComponent
func (*ComponentBase) NoopResource ¶
func (c *ComponentBase) NoopResource(obj client.Object, parent *ictrltypes.LifecycleVertex) *ictrltypes.LifecycleVertex
func (*ComponentBase) PatchResource ¶
func (c *ComponentBase) PatchResource(obj client.Object, objCopy client.Object, parent *ictrltypes.LifecycleVertex) *ictrltypes.LifecycleVertex
func (*ComponentBase) ResolveObjectsAction ¶
func (c *ComponentBase) ResolveObjectsAction(reqCtx intctrlutil.RequestCtx, cli client.Client) error
ResolveObjectsAction resolves the action of objects in dag to guarantee that all object actions will be determined.
func (*ComponentBase) SetStatusPhase ¶
func (c *ComponentBase) SetStatusPhase(phase appsv1alpha1.ClusterComponentPhase, statusMessage appsv1alpha1.ComponentMessageMap, phaseTransitionMsg string)
SetStatusPhase sets the cluster component phase and messages conditionally.
func (*ComponentBase) SetWorkload ¶
func (c *ComponentBase) SetWorkload(obj client.Object, action *ictrltypes.LifecycleAction, parent *ictrltypes.LifecycleVertex)
func (*ComponentBase) StatusWorkload ¶
func (c *ComponentBase) StatusWorkload(reqCtx intctrlutil.RequestCtx, cli client.Client, obj client.Object, txn *statusReconciliationTxn) error
func (*ComponentBase) UpdatePDB ¶
func (c *ComponentBase) UpdatePDB(reqCtx intctrlutil.RequestCtx, cli client.Client) error
func (*ComponentBase) UpdateResource ¶
func (c *ComponentBase) UpdateResource(obj client.Object, parent *ictrltypes.LifecycleVertex) *ictrltypes.LifecycleVertex
func (*ComponentBase) UpdateService ¶
func (c *ComponentBase) UpdateService(reqCtx intctrlutil.RequestCtx, cli client.Client) error
func (*ComponentBase) ValidateObjectsAction ¶
func (c *ComponentBase) ValidateObjectsAction() error
ValidateObjectsAction validates the action of objects in dag has been determined.
type ComponentWorkloadBuilder ¶
type ComponentWorkloadBuilder interface { // runtime, config, script, env, volume, service, monitor, probe BuildEnv() ComponentWorkloadBuilder BuildConfig() ComponentWorkloadBuilder BuildWorkload() ComponentWorkloadBuilder BuildPDB() ComponentWorkloadBuilder BuildVolumeMount() ComponentWorkloadBuilder BuildService() ComponentWorkloadBuilder BuildHeadlessService() ComponentWorkloadBuilder BuildTLSCert() ComponentWorkloadBuilder BuildTLSVolume() ComponentWorkloadBuilder Complete() error }
type ComponentWorkloadBuilderBase ¶
type ComponentWorkloadBuilderBase struct { ReqCtx intctrlutil.RequestCtx Client client.Client Comp types.Component DefaultAction *ictrltypes.LifecycleAction ConcreteBuilder ComponentWorkloadBuilder Error error EnvConfig *corev1.ConfigMap Workload client.Object LocalObjs []client.Object // cache the objects needed for configuration, should remove this after refactoring the configuration }
func (*ComponentWorkloadBuilderBase) BuildConfig ¶
func (b *ComponentWorkloadBuilderBase) BuildConfig() ComponentWorkloadBuilder
func (*ComponentWorkloadBuilderBase) BuildEnv ¶
func (b *ComponentWorkloadBuilderBase) BuildEnv() ComponentWorkloadBuilder
func (*ComponentWorkloadBuilderBase) BuildHeadlessService ¶
func (b *ComponentWorkloadBuilderBase) BuildHeadlessService() ComponentWorkloadBuilder
func (*ComponentWorkloadBuilderBase) BuildPDB ¶
func (b *ComponentWorkloadBuilderBase) BuildPDB() ComponentWorkloadBuilder
func (*ComponentWorkloadBuilderBase) BuildService ¶
func (b *ComponentWorkloadBuilderBase) BuildService() ComponentWorkloadBuilder
func (*ComponentWorkloadBuilderBase) BuildTLSCert ¶
func (b *ComponentWorkloadBuilderBase) BuildTLSCert() ComponentWorkloadBuilder
func (*ComponentWorkloadBuilderBase) BuildTLSVolume ¶
func (b *ComponentWorkloadBuilderBase) BuildTLSVolume() ComponentWorkloadBuilder
func (*ComponentWorkloadBuilderBase) BuildVolumeMount ¶
func (b *ComponentWorkloadBuilderBase) BuildVolumeMount() ComponentWorkloadBuilder
func (*ComponentWorkloadBuilderBase) BuildWorkload4StatefulSet ¶
func (b *ComponentWorkloadBuilderBase) BuildWorkload4StatefulSet(workloadType string) ComponentWorkloadBuilder
func (*ComponentWorkloadBuilderBase) BuildWrapper ¶
func (b *ComponentWorkloadBuilderBase) BuildWrapper(buildfn func() ([]client.Object, error)) ComponentWorkloadBuilder
func (*ComponentWorkloadBuilderBase) Complete ¶
func (b *ComponentWorkloadBuilderBase) Complete() error
type StatefulComponentBase ¶
type StatefulComponentBase struct { ComponentBase // contains filtered or unexported fields }
StatefulComponentBase as a base class for single stateful-set based component (stateful & replication & consensus).
func (*StatefulComponentBase) Create ¶
func (c *StatefulComponentBase) Create(reqCtx intctrlutil.RequestCtx, cli client.Client, builder ComponentWorkloadBuilder) error
func (*StatefulComponentBase) Delete ¶
func (c *StatefulComponentBase) Delete(reqCtx intctrlutil.RequestCtx, cli client.Client) error
func (*StatefulComponentBase) ExpandVolume ¶
func (c *StatefulComponentBase) ExpandVolume(reqCtx intctrlutil.RequestCtx, cli client.Client) error
func (*StatefulComponentBase) GetBuiltObjects ¶
func (c *StatefulComponentBase) GetBuiltObjects(builder ComponentWorkloadBuilder) ([]client.Object, error)
func (*StatefulComponentBase) HorizontalScale ¶
func (c *StatefulComponentBase) HorizontalScale(reqCtx intctrlutil.RequestCtx, cli client.Client) error
func (*StatefulComponentBase) Restart ¶
func (c *StatefulComponentBase) Restart(reqCtx intctrlutil.RequestCtx, cli client.Client) error
func (*StatefulComponentBase) Status ¶
func (c *StatefulComponentBase) Status(reqCtx intctrlutil.RequestCtx, cli client.Client, builder ComponentWorkloadBuilder) error
func (*StatefulComponentBase) Update ¶
func (c *StatefulComponentBase) Update(reqCtx intctrlutil.RequestCtx, cli client.Client, builder ComponentWorkloadBuilder) error
Click to show internal directories.
Click to hide internal directories.