controller

package
v1.17.4 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package controller contains the function in PGK that reacts to events in the cluster.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PgBouncerInstanceInterface

type PgBouncerInstanceInterface interface {
	Paused() bool
	Pause() error
	Resume() error
	Reload() error
}

PgBouncerInstanceInterface the public interface for a PgBouncer instance, implementations should be thread safe

func NewPgBouncerInstance

func NewPgBouncerInstance() PgBouncerInstanceInterface

NewPgBouncerInstance initializes a new pgBouncerInstance

type PgBouncerReconciler

type PgBouncerReconciler struct {
	// contains filtered or unexported fields
}

PgBouncerReconciler can reconcile the status of the PostgreSQL cluster with the one of this PostgreSQL instance. Also the configuration in the ConfigMap is applied when needed

func NewPgBouncerReconciler

func NewPgBouncerReconciler(poolerNamespacedName types.NamespacedName) (*PgBouncerReconciler, error)

NewPgBouncerReconciler creates a new pgbouncer reconciler

func (*PgBouncerReconciler) GetClient

func (r *PgBouncerReconciler) GetClient() ctrl.Client

GetClient returns the dynamic client that is being used for a certain reconciler

func (*PgBouncerReconciler) Init

Init ensures that all PgBouncer requirement are met.

In detail: 1. create the pgbouncer configuration and the required secrets 2. ensure that every needed folder is existent

func (*PgBouncerReconciler) Reconcile

func (r *PgBouncerReconciler) Reconcile(ctx context.Context, event *watch.Event) error

Reconcile is the main reconciliation loop for the pgbouncer instance

func (*PgBouncerReconciler) Run

func (r *PgBouncerReconciler) Run(ctx context.Context)

Run runs the reconciliation loop for this resource

func (*PgBouncerReconciler) Stop

func (r *PgBouncerReconciler) Stop()

Stop stops the controller

Jump to

Keyboard shortcuts

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