Documentation ¶
Overview ¶
Package controllers contains the controller of the CRD
Package controllers contains the controller of the CRD
Index ¶
- Constants
- Variables
- func GetManagedInstances(ctx context.Context, cluster *apiv1.Cluster, r client.Client) (corev1.PodList, error)
- func GetPodsNotOnPrimaryNode(status postgres.PostgresqlStatusList, primaryPod *postgres.PostgresqlStatus) postgres.PostgresqlStatusList
- func IsOwnedByCluster(obj client.Object) (string, bool)
- func ReconcileScheduledBackup(ctx context.Context, event record.EventRecorder, cli client.Client, ...) (ctrl.Result, error)
- type BackupReconciler
- type ClusterReconciler
- func (r *ClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *ClusterReconciler) RegisterPhase(ctx context.Context, cluster *apiv1.Cluster, phase string, reason string) error
- func (r *ClusterReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error
- type PoolerReconciler
- type ScheduledBackupReconciler
- func (r *ScheduledBackupReconciler) GetChildBackups(ctx context.Context, scheduledBackup apiv1.ScheduledBackup) ([]apiv1.Backup, error)
- func (r *ScheduledBackupReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *ScheduledBackupReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error
Constants ¶
const ( // ImmediateBackupLabelName label is applied to backups to tell if a backup // is immediate or not ImmediateBackupLabelName = utils.ImmediateBackupLabelName // ParentScheduledBackupLabelName label is applied to backups to easily tell the scheduled backup // it was created from. ParentScheduledBackupLabelName = utils.ParentScheduledBackupLabelName )
Variables ¶
var ErrNextLoop = utils.ErrNextLoop
ErrNextLoop see utils.ErrNextLoop
var ErrWaitingOnFailOverDelay = fmt.Errorf("current primary isn't healthy, waiting for the delay before triggering a failover") //nolint: lll
ErrWaitingOnFailOverDelay is raised when the primary server can't be elected because the .spec.failoverDelay hasn't elapsed yet
var ErrWalReceiversRunning = fmt.Errorf("wal receivers are still running")
ErrWalReceiversRunning is raised when a new primary server can't be elected because there is a WAL receiver running in our Pod list
Functions ¶
func GetManagedInstances ¶ added in v1.19.0
func GetManagedInstances(ctx context.Context, cluster *apiv1.Cluster, r client.Client) (corev1.PodList, error)
GetManagedInstances gets all the instances associated with the given Cluster
func GetPodsNotOnPrimaryNode ¶
func GetPodsNotOnPrimaryNode( status postgres.PostgresqlStatusList, primaryPod *postgres.PostgresqlStatus, ) postgres.PostgresqlStatusList
GetPodsNotOnPrimaryNode filters out only pods that are not on the same node as the primary one
func IsOwnedByCluster ¶ added in v1.17.0
IsOwnedByCluster checks that an object is owned by a Cluster and returns the owner name
func ReconcileScheduledBackup ¶
func ReconcileScheduledBackup( ctx context.Context, event record.EventRecorder, cli client.Client, scheduledBackup *apiv1.ScheduledBackup, ) (ctrl.Result, error)
ReconcileScheduledBackup is the main reconciliation logic for a scheduled backup
Types ¶
type BackupReconciler ¶
type BackupReconciler struct { client.Client DiscoveryClient discovery.DiscoveryInterface Scheme *runtime.Scheme Recorder record.EventRecorder // contains filtered or unexported fields }
BackupReconciler reconciles a Backup object
func NewBackupReconciler ¶ added in v1.19.0
func NewBackupReconciler(mgr manager.Manager, discoveryClient *discovery.DiscoveryClient) *BackupReconciler
NewBackupReconciler properly initializes the BackupReconciler
func (*BackupReconciler) SetupWithManager ¶
SetupWithManager sets up this controller given a controller manager
type ClusterReconciler ¶
type ClusterReconciler struct { client.Client DiscoveryClient discovery.DiscoveryInterface Scheme *runtime.Scheme Recorder record.EventRecorder *instance.StatusClient }
ClusterReconciler reconciles a Cluster objects
func NewClusterReconciler ¶
func NewClusterReconciler(mgr manager.Manager, discoveryClient *discovery.DiscoveryClient) *ClusterReconciler
NewClusterReconciler creates a new ClusterReconciler initializing it
func (*ClusterReconciler) RegisterPhase ¶
func (r *ClusterReconciler) RegisterPhase(ctx context.Context, cluster *apiv1.Cluster, phase string, reason string, ) error
RegisterPhase update phase in the status cluster with the proper reason
func (*ClusterReconciler) SetupWithManager ¶
SetupWithManager creates a ClusterReconciler
type PoolerReconciler ¶
type PoolerReconciler struct { client.Client DiscoveryClient discovery.DiscoveryInterface Scheme *runtime.Scheme Recorder record.EventRecorder }
PoolerReconciler reconciles a Pooler object
func (*PoolerReconciler) Reconcile ¶
Reconcile implements the main reconciliation loop for pooler objects
func (*PoolerReconciler) SetupWithManager ¶
func (r *PoolerReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager setup this controller inside the controller manager
type ScheduledBackupReconciler ¶
type ScheduledBackupReconciler struct { client.Client Scheme *runtime.Scheme Recorder record.EventRecorder }
ScheduledBackupReconciler reconciles a ScheduledBackup object
func (*ScheduledBackupReconciler) GetChildBackups ¶
func (r *ScheduledBackupReconciler) GetChildBackups( ctx context.Context, scheduledBackup apiv1.ScheduledBackup, ) ([]apiv1.Backup, error)
GetChildBackups gets all the backups scheduled by a certain scheduler
func (*ScheduledBackupReconciler) Reconcile ¶
func (r *ScheduledBackupReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is the main reconciler logic
func (*ScheduledBackupReconciler) SetupWithManager ¶
SetupWithManager install this controller in the controller manager
Source Files ¶
- backup_controller.go
- backup_predicates.go
- cluster_cleanup.go
- cluster_controller.go
- cluster_create.go
- cluster_delete.go
- cluster_image.go
- cluster_pki.go
- cluster_plugins.go
- cluster_predicates.go
- cluster_restore.go
- cluster_scale.go
- cluster_status.go
- cluster_upgrade.go
- plugins.go
- pooler_controller.go
- pooler_predicates.go
- pooler_resources.go
- pooler_status.go
- pooler_update.go
- replicas.go
- scheduledbackup_controller.go