Documentation
¶
Overview ¶
Package database manages MariaDB database resources for CobaltCore operators. It provides functions for ensuring Database, User, and Grant CRs exist and running database synchronization jobs.
Feature: CC-0005
Index ¶
- func EnsureDatabase(ctx context.Context, c client.Client, scheme *runtime.Scheme, ...) (bool, error)
- func EnsureDatabaseUser(ctx context.Context, c client.Client, scheme *runtime.Scheme, ...) (bool, error)
- func IsDatabaseReady(db *mariadbv1alpha1.Database) bool
- func IsGrantReady(grant *mariadbv1alpha1.Grant) bool
- func IsUserReady(user *mariadbv1alpha1.User) bool
- func RunDBSyncJob(ctx context.Context, c client.Client, scheme *runtime.Scheme, ...) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureDatabase ¶
func EnsureDatabase(ctx context.Context, c client.Client, scheme *runtime.Scheme, owner client.Object, db *mariadbv1alpha1.Database) (bool, error)
EnsureDatabase creates a MariaDB Database CR if it does not exist or updates its spec if it already exists. It returns (true, nil) when the Database has a Ready condition with status True, (false, nil) when it exists but is not yet ready, and (false, error) on unexpected failures (CC-0005).
func EnsureDatabaseUser ¶
func EnsureDatabaseUser(ctx context.Context, c client.Client, scheme *runtime.Scheme, owner client.Object, user *mariadbv1alpha1.User, grant *mariadbv1alpha1.Grant) (bool, error)
EnsureDatabaseUser creates or updates a MariaDB User CR and a Grant CR. It returns (true, nil) when both User and Grant have a Ready condition with status True, (false, nil) when either is not yet ready, and (false, error) on unexpected failures (CC-0005).
func IsDatabaseReady ¶
func IsDatabaseReady(db *mariadbv1alpha1.Database) bool
IsDatabaseReady returns true if the Database has a Ready condition with status True (CC-0005).
func IsGrantReady ¶
func IsGrantReady(grant *mariadbv1alpha1.Grant) bool
IsGrantReady returns true if the Grant has a Ready condition with status True (CC-0005).
func IsUserReady ¶
func IsUserReady(user *mariadbv1alpha1.User) bool
IsUserReady returns true if the User has a Ready condition with status True (CC-0005).
func RunDBSyncJob ¶
func RunDBSyncJob(ctx context.Context, c client.Client, scheme *runtime.Scheme, owner client.Object, syncJob *batchv1.Job) (bool, error)
RunDBSyncJob creates a database synchronization Job if it does not already exist and reports whether the Job has completed successfully. It delegates to job.RunJob (CC-0005).
Types ¶
This section is empty.