backup

package
v0.0.0-...-be29cce Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backup

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

func NewBackup

func NewBackup(context context.Context, clientTools *clienttools.ClientTools, syndesis *synapi.Syndesis, backupDir string) (*Backup, error)

func (*Backup) BuildBackupDir

func (b *Backup) BuildBackupDir(path string) (r *Backup, err error)

* Because there is some incoherency with the path for backup and for restore, * it is needed to transform it from backup to restore so that the restore * can be performed

func (*Backup) Restore

func (b *Backup) Restore() (err error)

Restore backup from a zipped file or from a backup dir Restore database and openshift resources

func (*Backup) RestoreDb

func (b *Backup) RestoreDb() (err error)
  • Rationale for architecture *
  • 1 container in the pod - RESTORE_CONTAINER *
  • Container mounts a single ephemeral volume *
  • RESTORE_CONTAINER: Restores the dump file *
  • This starts the process by executing a remote command on to the
  • RESTORE_CONTAINER. The remote command uploads the dump file to
  • the correct location then once finished touches a file as a signal
  • for the RESTORE_CONTAINER. *
  • When the RESTORE_CONTAINER, espies the file, it breaks its wait loop
  • & begins the restore process to the database host. *
  • Once the restore has completed then there is nothing more to be done.

Restore database

func (*Backup) RestoreResources

func (b *Backup) RestoreResources() (err error)

Restore openshift resources

func (*Backup) Run

func (b *Backup) Run() (err error)

Create a backup, zip it and upload it to different datastores

func (*Backup) SetCustomOptions

func (b *Backup) SetCustomOptions(customOptions string) error

func (*Backup) SetDelete

func (b *Backup) SetDelete(delete bool) error

func (*Backup) SetLocalOnly

func (b *Backup) SetLocalOnly(localOnly bool) error

func (*Backup) Validate

func (b *Backup) Validate() (err error)

Validates that a given backup has a correct format and is the right version

type BkpJobTask

type BkpJobTask func(bkpPod *corev1.Pod) (bool, error)

type Downloader

type Downloader interface {
	Download(dir string) (err error)
	Enabled() (result bool)
}

downloader interface has methods to download backup files from a remote location

type Runner

type Runner interface {
	Run() error
	Restore() error
	Validate() error
	RestoreResources() error
	RestoreDb() error
	BuildBackupDir(path string) (r *Backup, err error)
}

type S3

type S3 struct {
	*Backup
	// contains filtered or unexported fields
}

func (*S3) Enabled

func (s *S3) Enabled() (result bool)

func (*S3) Status

func (s *S3) Status() (err error)

func (*S3) Upload

func (s *S3) Upload(dir string) (err error)

type Uploader

type Uploader interface {
	// Upload backup files to a remote location
	Upload(dir string) (err error)

	// Update syndesis status to reflect an upload
	Status() (err error)

	// Can this uploader be used with current settings
	Enabled() (result bool)
}

Uploader interface has methods to upload backup files to a remote datastore

Jump to

Keyboard shortcuts

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