context

package
v0.0.0-...-658d3ce Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterContext

type ClusterContext struct {
	// base reconcileContext
	kube.ReconcileContext
	// contains filtered or unexported fields
}

func NewClusterContext

func NewClusterContext(base kube.ReconcileContext) *ClusterContext

func (*ClusterContext) DeleteFinalizer

func (rc *ClusterContext) DeleteFinalizer(key string) []string

DeleteFinalizer delete finalizer

func (*ClusterContext) GetCluster

func (rc *ClusterContext) GetCluster() *v1.KDBCluster

GetInstance get current instance object

func (*ClusterContext) GetGlobalConfig

func (rc *ClusterContext) GetGlobalConfig() config.GlobalConfig

func (*ClusterContext) GetObservedCluster

func (rc *ClusterContext) GetObservedCluster() *observed.ObservedCluster

func (*ClusterContext) GetOldCluster

func (rc *ClusterContext) GetOldCluster() *v1.KDBCluster

GetOldInstance get the instance object before changed

func (*ClusterContext) HasFinalizer

func (rc *ClusterContext) HasFinalizer(key string) bool

HasFinalizer determine if the finalizer exists

func (*ClusterContext) InitCluster

func (rc *ClusterContext) InitCluster() (*v1.KDBCluster, error)

InitCluster initialize instance

func (*ClusterContext) InitObservedCluster

func (rc *ClusterContext) InitObservedCluster(instances *v1.KDBInstanceList)

func (*ClusterContext) IsDeleted

func (rc *ClusterContext) IsDeleted() bool

IsDeleted The instance is being deleted and there is no finalizer.

func (*ClusterContext) IsDeleting

func (rc *ClusterContext) IsDeleting() bool

IsDeleting The cluster is being deleted and our finalizer is still set.

func (*ClusterContext) IsStopReconcile

func (rc *ClusterContext) IsStopReconcile() bool

IsStopReconcile is the cluster stop reconcile

func (*ClusterContext) SetGlobalConfig

func (rc *ClusterContext) SetGlobalConfig(config *config.GlobalConfig)

type InstanceContext

type InstanceContext struct {
	// base reconcileContext
	kube.ReconcileContext
	// contains filtered or unexported fields
}

func NewInstanceContext

func NewInstanceContext(base kube.ReconcileContext) *InstanceContext

func (*InstanceContext) DeleteControlled

func (rc *InstanceContext) DeleteControlled(
	object client.Object,
) error

DeleteControlled safely deletes object when it is controlled by cluster.

func (*InstanceContext) DeleteFinalizer

func (rc *InstanceContext) DeleteFinalizer(key string) []string

DeleteFinalizer delete finalizer

func (*InstanceContext) GetClusterServiceAccountName

func (rc *InstanceContext) GetClusterServiceAccountName() string

func (*InstanceContext) GetGlobalConfig

func (rc *InstanceContext) GetGlobalConfig() config.GlobalConfig

func (*InstanceContext) GetInstance

func (rc *InstanceContext) GetInstance() *v1.KDBInstance

GetInstance get current instance object

func (*InstanceContext) GetInstanceConfigMap

func (rc *InstanceContext) GetInstanceConfigMap() *corev1.ConfigMap

func (*InstanceContext) GetInstancePodService

func (rc *InstanceContext) GetInstancePodService() *corev1.Service

func (*InstanceContext) GetObservedInstance

func (rc *InstanceContext) GetObservedInstance() *observed.ObservedSingleInstance

func (*InstanceContext) GetOldInstance

func (rc *InstanceContext) GetOldInstance() *v1.KDBInstance

GetOldInstance get the instance object before changed

func (*InstanceContext) GetVolumes

func (rc *InstanceContext) GetVolumes() ([]corev1.PersistentVolumeClaim, error)

func (*InstanceContext) HandlePersistentVolumeClaimError

func (rc *InstanceContext) HandlePersistentVolumeClaimError(err error) error

HandlePersistentVolumeClaimError inspects err for expected Kubernetes API responses to writing a PVC. It turns errors it understands into conditions and events. When err is handled it returns nil. Otherwise it returns err.

func (*InstanceContext) HasFinalizer

func (rc *InstanceContext) HasFinalizer(key string) bool

HasFinalizer determine if the finalizer exists

func (*InstanceContext) InitInstance

func (rc *InstanceContext) InitInstance() (*v1.KDBInstance, error)

InitInstance initialize instance TODO add default param or config for mysql and pg

func (*InstanceContext) IsDeleted

func (rc *InstanceContext) IsDeleted() bool

IsDeleted The instance is being deleted and there is no finalizer.

func (*InstanceContext) IsDeleting

func (rc *InstanceContext) IsDeleting() bool

IsDeleting The cluster is being deleted and our finalizer is still set.

func (*InstanceContext) IsStopReconcile

func (rc *InstanceContext) IsStopReconcile() bool

IsStopReconcile is the cluster stop reconcile

func (*InstanceContext) PatchKDBInstance

func (rc *InstanceContext) PatchKDBInstance() error

PatchKDBInstance the function for the updating the mysql instance. Returns any error that occurs while attempting to patch the instance

func (*InstanceContext) PatchKDBInstanceStatus

func (rc *InstanceContext) PatchKDBInstanceStatus() error

PatchKDBInstanceStatus the function for the updating the KDBInstance status. Returns any error that occurs while attempting to patch the status

func (*InstanceContext) SetClusterServiceAccount

func (rc *InstanceContext) SetClusterServiceAccount(sa *corev1.ServiceAccount)

func (*InstanceContext) SetControllerReference

func (rc *InstanceContext) SetControllerReference(
	controlled client.Object,
) error

SetControllerReference sets owner as a Controller OwnerReference on controlled. Only one OwnerReference can be a controller, so it returns an error if another is already set.

func (*InstanceContext) SetGlobalConfig

func (rc *InstanceContext) SetGlobalConfig(config *config.GlobalConfig)

func (*InstanceContext) SetInstanceConfigMap

func (rc *InstanceContext) SetInstanceConfigMap(cm *corev1.ConfigMap)

func (*InstanceContext) SetInstancePodService

func (rc *InstanceContext) SetInstancePodService(service *corev1.Service)

func (*InstanceContext) SetObservedInstance

func (rc *InstanceContext) SetObservedInstance(instance *observed.ObservedSingleInstance)

func (*InstanceContext) SetOwnerReference

func (rc *InstanceContext) SetOwnerReference(
	controlled client.Object,
) error

SetOwnerReference sets an OwnerReference on the object without setting the owner as a controller. This allows for multiple OwnerReferences on an object.

func (*InstanceContext) Volumes

Jump to

Keyboard shortcuts

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