databasecontroller

package
v0.5.0-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CheckStatusInstanceFunc = controllers.CheckStatusInstanceFunc
)

These variables allow to plug in mock objects for functional tests

Functions

func NewDatabase

func NewDatabase(ctx context.Context, r *DatabaseReconciler, db *v1alpha1.Database, dbDomain, cdbName string, log logr.Logger) (bool, error)

NewDatabase attempts to create a new PDB if it doesn't exist yet. The first return value of NewDatabase is "bail out or not?". If a PDB is new, just created now, NewDatabase returns bail=false. If it's an existing PDB, NewDatabase returns bail=true (so that the rest of the workflow, e.g. creating users step, is not attempted).

func NewUsers

func NewUsers(ctx context.Context, r *DatabaseReconciler, db *v1alpha1.Database, dbDomain, cdbName string, log logr.Logger) error

NewUsers attempts to create a new user.

func SyncUsers

func SyncUsers(ctx context.Context, r *DatabaseReconciler, db *v1alpha1.Database, cdbName string, log logr.Logger) error

SyncUsers attempts to update PDB users.

Types

type DatabaseReconciler

type DatabaseReconciler struct {
	client.Client
	Log                   logr.Logger
	Scheme                *runtime.Scheme
	Recorder              record.EventRecorder
	InstanceLocks         *sync.Map
	DatabaseClientFactory controllers.DatabaseClientFactory
}

DatabaseReconciler reconciles a Database object

func (*DatabaseReconciler) Reconcile

func (r *DatabaseReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is the main method that reconciles the Database resource.

func (*DatabaseReconciler) ReconcileDatabaseCreation

func (r *DatabaseReconciler) ReconcileDatabaseCreation(ctx context.Context, req ctrl.Request, log logr.Logger) (ctrl.Result, error)

func (*DatabaseReconciler) ReconcileDatabaseDeletion

func (r *DatabaseReconciler) ReconcileDatabaseDeletion(ctx context.Context, req ctrl.Request, log logr.Logger) (ctrl.Result, error)

func (*DatabaseReconciler) SetupWithManager

func (r *DatabaseReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager starts the reconciler loop.

Jump to

Keyboard shortcuts

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