databaseclaim

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// InfoLevel is used to set V level to 0 as suggested by official docs
	// https://github.com/kubernetes-sigs/controller-runtime/blob/main/TMP-LOGGING.md
	InfoLevel = 0
	// DebugLevel is used to set V level to 1 as suggested by official docs
	// https://github.com/kubernetes-sigs/controller-runtime/blob/main/TMP-LOGGING.md
	DebugLevel = 1

	// FIXME: remove references to private variables
	OperationalStatusTagKey        string = "operational-status"
	OperationalStatusInactiveValue string = "inactive"
	OperationalStatusActiveValue   string = "active"
)
View Source
var (
	ErrMaxNameLen     = fmt.Errorf("dbclaim name is too long. max length is 44 characters")
	ErrInvalidDSNName = fmt.Errorf("dsn name must be: %s", v1.DSNKey)
)
View Source
var (
	ErrDoNotUpdateStatus = fmt.Errorf("do not update status for this error")
)
View Source
var ErrInvalidCredentialsPasswordMissing = fmt.Errorf("invalid_credentials_password_missing")

Functions

func HasOperationalTag

func HasOperationalTag(tags []*crossplanerds.Tag) bool

func MakeDeepCopyToOldDB

func MakeDeepCopyToOldDB(to *v1.StatusForOldDB, from *v1.Status)

func ReplaceOrAddTag

func ReplaceOrAddTag(tags []*crossplanerds.Tag, key string, value string) []*crossplanerds.Tag

Types

type DBClaimTags

type DBClaimTags []persistancev1.Tag

func (DBClaimTags) DBTags

func (r DBClaimTags) DBTags() DBTags

func (DBClaimTags) Len

func (r DBClaimTags) Len() int

implementation of sort interface to allow canolicalization of tags

func (DBClaimTags) Less

func (r DBClaimTags) Less(i, j int) bool

func (DBClaimTags) Swap

func (r DBClaimTags) Swap(i, j int)

type DBTags

type DBTags []*crossplanerds.Tag

type DatabaseClaimConfig

type DatabaseClaimConfig struct {
	Viper                 *viper.Viper
	MasterAuth            *rdsauth.MasterAuth
	DbIdentifierPrefix    string
	Class                 string
	Namespace             string
	MetricsEnabled        bool
	MetricsDepYamlPath    string
	MetricsConfigYamlPath string
}

type DatabaseClaimReconciler

type DatabaseClaimReconciler struct {
	client.Client
	Config *DatabaseClaimConfig

	// FIXME: give this a meaningful name
	Input *input
	// contains filtered or unexported fields
}

DatabaseClaimReconciler reconciles a DatabaseClaim object

func (*DatabaseClaimReconciler) ManageOperationalTagging

func (r *DatabaseClaimReconciler) ManageOperationalTagging(ctx context.Context, logr logr.Logger, dbInstanceName, dbParamGroupName string) (bool, error)

ManageOperationalTagging: Will update operational tags on old DBInstance, DBCluster, DBClusterParamGroup and DBParamGroup. It does not return error for DBCluster, DBClusterParamGroup and DBParamGroup if they fail to update tags. Such error is only logged, but not returned. In case of successful updation, It does not to verify whether those tags got updated.

Unlike other resources, It returns error just for DBinstance failling to update tags. It also verifies whether DBinstance got updated with the tag, and return the signal as boolean.

true: operational tag is updated and verfied.
false: operational tag is updated but could not be verified yet.

func (*DatabaseClaimReconciler) Reconcile

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

type ModeEnum

type ModeEnum int
const (
	M_NotSupported ModeEnum = iota
	M_UseExistingDB
	M_MigrateExistingToNewDB
	M_MigrationInProgress
	M_UseNewDB
	M_InitiateDBUpgrade
	M_UpgradeDBInProgress
	M_PostMigrationInProgress
)

Jump to

Keyboard shortcuts

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