Documentation ¶
Index ¶
- Constants
- Variables
- func BackupCronJob(cr *api.PerconaServerMongoDB, task *api.BackupTaskSpec) (batchv1.CronJob, error)
- func BackupFromTask(cr *api.PerconaServerMongoDB, task *api.BackupTaskSpec) (*api.PerconaServerMongoDBBackup, error)
- func GetPBMConfig(ctx context.Context, k8sclient client.Client, ...) (config.Config, error)
- func GetPriorities(ctx context.Context, k8sclient client.Client, ...) (map[string]float64, error)
- func HasActiveJobs(ctx context.Context, newPBMFunc NewPBMFunc, cl client.Client, ...) (bool, error)
- func IsPBMNotConfiguredError(err error) bool
- func IsPITRLock(l lock.LockHeader) bool
- func NotPITRLock(l lock.LockHeader) bool
- type BackupMeta
- type Job
- type JobType
- type LockHeaderPredicate
- type NewPBMFunc
- type PBM
Constants ¶
View Source
const ( AWSAccessKeySecretKey = "AWS_ACCESS_KEY_ID" AWSSecretAccessKeySecretKey = "AWS_SECRET_ACCESS_KEY" AzureStorageAccountNameSecretKey = "AZURE_STORAGE_ACCOUNT_NAME" AzureStorageAccountKeySecretKey = "AZURE_STORAGE_ACCOUNT_KEY" SSECustomerKey = "SSE_CUSTOMER_KEY" KMSKeyID = "KMS_KEY_ID" )
Variables ¶
View Source
var ErrNoOplogsForPITR = errors.New("there is no oplogs that can cover the date/time or no oplogs at all")
Functions ¶
func BackupCronJob ¶
func BackupCronJob(cr *api.PerconaServerMongoDB, task *api.BackupTaskSpec) (batchv1.CronJob, error)
func BackupFromTask ¶ added in v1.13.0
func BackupFromTask(cr *api.PerconaServerMongoDB, task *api.BackupTaskSpec) (*api.PerconaServerMongoDBBackup, error)
func GetPBMConfig ¶ added in v1.14.0
func GetPriorities ¶ added in v1.14.0
func GetPriorities(ctx context.Context, k8sclient client.Client, cluster *api.PerconaServerMongoDB) (map[string]float64, error)
GetPriorities returns priorities to be used in PBM config.
func HasActiveJobs ¶ added in v1.4.0
func HasActiveJobs(ctx context.Context, newPBMFunc NewPBMFunc, cl client.Client, cluster *api.PerconaServerMongoDB, current Job, allowLock ...LockHeaderPredicate) (bool, error)
HasActiveJobs returns true if there are running backups or restores in given cluster and namespace
func IsPBMNotConfiguredError ¶ added in v1.16.0
func IsPITRLock ¶ added in v1.8.0
func IsPITRLock(l lock.LockHeader) bool
func NotPITRLock ¶ added in v1.8.0
func NotPITRLock(l lock.LockHeader) bool
Types ¶
type BackupMeta ¶ added in v1.16.0
type BackupMeta = backup.BackupMeta
type Job ¶ added in v1.4.0
func NewBackupJob ¶ added in v1.8.0
func NewRestoreJob ¶ added in v1.8.0
func NewRestoreJob(cr *api.PerconaServerMongoDBRestore) Job
type LockHeaderPredicate ¶ added in v1.8.0
type LockHeaderPredicate func(lock.LockHeader) bool
func NotJobLock ¶ added in v1.8.0
func NotJobLock(j Job) LockHeaderPredicate
type NewPBMFunc ¶ added in v1.15.0
type PBM ¶ added in v1.4.0
type PBM interface { Conn() *mongo.Client GetPITRChunkContains(ctx context.Context, unixTS int64) (*oplog.OplogChunk, error) GetLatestTimelinePITR(ctx context.Context) (oplog.Timeline, error) PITRGetChunksSlice(ctx context.Context, rs string, from, to primitive.Timestamp) ([]oplog.OplogChunk, error) PITRChunksCollection() *mongo.Collection Logger() pbmLog.Logger GetStorage(ctx context.Context, e pbmLog.LogEvent) (storage.Storage, error) ResyncStorage(ctx context.Context, e pbmLog.LogEvent) error SendCmd(ctx context.Context, cmd ctrl.Cmd) error Close(ctx context.Context) error HasLocks(ctx context.Context, predicates ...LockHeaderPredicate) (bool, error) ValidateBackup(ctx context.Context, bcp *psmdbv1.PerconaServerMongoDBBackup, cfg config.Config) error GetBackupMeta(ctx context.Context, bcpName string) (*backup.BackupMeta, error) GetRestoreMeta(ctx context.Context, name string) (*restore.RestoreMeta, error) DeleteBackup(ctx context.Context, name string) error SetConfig(ctx context.Context, k8sclient client.Client, cluster *api.PerconaServerMongoDB, stg api.BackupStorageSpec) error SetConfigVar(ctx context.Context, key, val string) error GetConfigVar(ctx context.Context, key string) (any, error) DeleteConfigVar(ctx context.Context, key string) error Node(ctx context.Context) (string, error) }
Click to show internal directories.
Click to hide internal directories.