databasecontroller

package
v0.2.0-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DatabaseContainerName = "oracledb"
)

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(_ context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is the main method that reconciles the Database resource.

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