backup

package
Version: v0.1.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnnoBackupConfig = "backup"
	BackupGroup      = "etcd.database.coreos.com"
	BackupVersion    = "v1beta2"
	BackupResource   = "etcdbackups"
	BackupKind       = "EtcdBackup"
)

Variables

View Source
var (
	BackupSchema = schema.GroupVersionResource{
		Group:    BackupGroup,
		Version:  BackupVersion,
		Resource: BackupResource,
	}
)
View Source
var (
	Providers = make(map[string]Factory)
)

Functions

func RegisterBackupStorageFactory

func RegisterBackupStorageFactory(name string, factory Factory)

RegisterBackupStorageFactory registers the specified backup storage provider

Types

type Config

type Config struct {
	StorageType              backupapiv2.BackupStorageType `json:"storageType"`
	StoragePolicy            *backupapiv2.BackupPolicy     `json:"backupPolicy,omitempty"`
	backupapiv2.BackupSource `json:",inline"`
}

type Factory

type Factory func(cfg *StorageConfig) (Storage, error)

type Server

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

func NewBackupServer

func NewBackupServer(clientBuilder util.ClientBuilder) (*Server, error)

NewBackupServer generates backup provider

func (*Server) CheckEqualIfDisabled

func (bak *Server) CheckEqualIfDisabled(cluster *kstonev1alpha1.EtcdCluster) bool

CheckEqualIfDisabled checks whether the backup resource is not found if it is disabled

func (*Server) CheckEqualIfEnabled

func (bak *Server) CheckEqualIfEnabled(cluster *kstonev1alpha1.EtcdCluster) bool

CheckEqualIfEnabled checks whether the backup resource is equal if it is enabled

func (*Server) CleanBackup

func (bak *Server) CleanBackup(cluster *kstonev1alpha1.EtcdCluster) error

CleanBackup cleans the etcdbackup if it is disabled.

func (*Server) CreateEtcdBackupByYaml

func (bak *Server) CreateEtcdBackupByYaml(backup *backupapiv2.EtcdBackup) error

CreateEtcdBackupByYaml creates etcd backup by yaml

func (*Server) DeleteEtcdBackup

func (bak *Server) DeleteEtcdBackup(name, namespace string) error

DeleteEtcdBackup deletes etcd backup

func (*Server) Equal

func (bak *Server) Equal(cluster *kstonev1alpha1.EtcdCluster) bool

Equal checks whether the backup resource needs to be updated

func (*Server) GetEtcdBackup

func (bak *Server) GetEtcdBackup(name, namespace string) (*backupapiv2.EtcdBackup, error)

GetEtcdBackup gets etcd backup

func (*Server) SyncBackup

func (bak *Server) SyncBackup(cluster *kstonev1alpha1.EtcdCluster) error

SyncBackup synchronizes the etcdbackup if it is enabled.

func (*Server) UpdateEtcdBackup

func (bak *Server) UpdateEtcdBackup(backup *backupapiv2.EtcdBackup) (*backupapiv2.EtcdBackup, error)

UpdateEtcdBackup updates etcd backup

type Storage

type Storage interface {
	// List gets all backup files from object storage.
	List(cluster *v1alpha1.EtcdCluster) (interface{}, error)

	// Stat counts the number of backup file in the last day.
	Stat(objects interface{}) (int, error)
}

Storage is an abstract, pluggable interface for etcd backup storage.

func GetBackupStorageProvider

func GetBackupStorageProvider(name string, config *StorageConfig) (Storage, error)

GetBackupStorageProvider gets the specified backup storage provider

type StorageConfig

type StorageConfig struct {
	KubeCli kubernetes.Interface
}

Directories

Path Synopsis
cos

Jump to

Keyboard shortcuts

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