backup

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2021 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 RegisterBackupFactory

func RegisterBackupFactory(name string, factory Factory)

RegisterBackupFactory registers the specified backup 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 *ProviderConfig) (Provider, error)

type Provider

type Provider interface {
	List(cluster *v1alpha1.EtcdCluster) (interface{}, error)
}

func GetBackupProvider

func GetBackupProvider(name string, config *ProviderConfig) (Provider, error)

GetBackupProvider gets the specified backup provider

type ProviderConfig

type ProviderConfig struct {
	Kubeconfig string
}

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

Directories

Path Synopsis
cos

Jump to

Keyboard shortcuts

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