internal

package
v0.6.0-alpha.19 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: AGPL-3.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPodFailedAndTimedOut

func IsPodFailedAndTimedOut(pod *corev1.Pod) (bool, bool, string)

IsPodFailedAndTimedOut checks if the pod is failed and timed out.

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 (*ComponentBase) CreateResource

func (*ComponentBase) DeleteResource

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 (*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 (*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 (*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 (*ComponentWorkloadBuilderBase) BuildEnv

func (*ComponentWorkloadBuilderBase) BuildHeadlessService

func (b *ComponentWorkloadBuilderBase) BuildHeadlessService() ComponentWorkloadBuilder

func (*ComponentWorkloadBuilderBase) BuildPDB

func (*ComponentWorkloadBuilderBase) BuildService

func (*ComponentWorkloadBuilderBase) BuildTLSCert

func (*ComponentWorkloadBuilderBase) BuildTLSVolume

func (*ComponentWorkloadBuilderBase) BuildVolumeMount

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 (*StatefulComponentBase) Delete

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 (*StatefulComponentBase) Status

func (*StatefulComponentBase) Update

Jump to

Keyboard shortcuts

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