database

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 13 Imported by: 10

Documentation

Index

Constants

View Source
const (

	// ReasonDBError - DB error
	ReasonDBError condition.Reason = "DatabaseError"
	// ReasonDBPatchError - new resource set to reason Init
	ReasonDBPatchError condition.Reason = "DatabasePatchError"
	// ReasonDBPathOK - DB object created or patched ok
	ReasonDBPatchOK condition.Reason = "DatabasePatchOK"
	// ReasonDBNotFound - DB object not found
	ReasonDBNotFound condition.Reason = "DatabaseNotFound"
	// ReasonDBWaitingInitialized - waiting for service DB to be initialized
	ReasonDBWaitingInitialized condition.Reason = "DatabaseWaitingInitialized"
	// ReasonDBServiceNameError - error getting the DB service hostname
	ReasonDBServiceNameError condition.Reason = "DatabaseServiceNameError"

	// ReasonDBSync - Database sync in progress
	ReasonDBSync condition.Reason = "DBSync"
)

Conditions for status in web console

View Source
const (
	// DatabaseUserPasswordKey - key in secret which holds the service user DB password
	DatabaseUserPasswordKey = "DatabasePassword"
	// DatabaseAdminPasswordKey - key in secret which holds the admin user password
	DatabaseAdminPasswordKey = "AdminPassword"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

Database -

func GetDatabaseByName

func GetDatabaseByName(
	ctx context.Context,
	h *helper.Helper,
	name string,
) (*Database, error)

GetDatabaseByName returns a *Database object with specified name and namespace

func NewDatabase

func NewDatabase(
	databaseName string,
	databaseUser string,
	secret string,
	labels map[string]string,
) *Database

NewDatabase returns an initialized DB.

func NewDatabaseWithNamespace

func NewDatabaseWithNamespace(
	databaseName string,
	databaseUser string,
	secret string,
	labels map[string]string,
	name string,
	namespace string,
) *Database

NewDatabaseWithNamespace returns an initialized DB.

func (*Database) CreateOrPatchDB

func (d *Database) CreateOrPatchDB(
	ctx context.Context,
	h *helper.Helper,
) (ctrl.Result, error)

CreateOrPatchDB - create or patch the service DB instance Deprecated. Use CreateOrPatchDBByName instead. If you want to use the default the DB service instance of the deployment then pass "openstack" as the name.

func (*Database) CreateOrPatchDBByName

func (d *Database) CreateOrPatchDBByName(
	ctx context.Context,
	h *helper.Helper,
	name string,
) (ctrl.Result, error)

CreateOrPatchDBByName - create or patch the service DB instance on the DB service. The DB service is selected by the name of the MariaDB CR providing the service.

func (*Database) DeepCopy

func (in *Database) DeepCopy() *Database

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Database.

func (*Database) DeepCopyInto

func (in *Database) DeepCopyInto(out *Database)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Database) DeleteFinalizer

func (d *Database) DeleteFinalizer(
	ctx context.Context,
	h *helper.Helper,
) error

DeleteFinalizer deletes a finalizer by its object

func (*Database) GetDatabase

func (d *Database) GetDatabase() *mariadbv1.MariaDBDatabase

GetDatabase - returns the DB

func (*Database) GetDatabaseHostname

func (d *Database) GetDatabaseHostname() string

GetDatabaseHostname - returns the DB hostname which host the DB

func (*Database) WaitForDBCreated

func (d *Database) WaitForDBCreated(
	ctx context.Context,
	h *helper.Helper,
) (ctrl.Result, error)

WaitForDBCreated - wait until the MariaDBDatabase is initialized and reports Status.Completed == true Deprecated, use WaitForDBCreatedWithTimeout instead

func (*Database) WaitForDBCreatedWithTimeout

func (d *Database) WaitForDBCreatedWithTimeout(
	ctx context.Context,
	h *helper.Helper,
	requeueAfter time.Duration,
) (ctrl.Result, error)

WaitForDBCreatedWithTimeout - wait until the MariaDBDatabase is initialized and reports Status.Completed == true

Jump to

Keyboard shortcuts

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