Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterBackupFactory(name string, factory Factory)
- type Config
- type Factory
- type Provider
- type ProviderConfig
- type Server
- func (bak *Server) CheckEqualIfDisabled(cluster *kstonev1alpha1.EtcdCluster) bool
- func (bak *Server) CheckEqualIfEnabled(cluster *kstonev1alpha1.EtcdCluster) bool
- func (bak *Server) CleanBackup(cluster *kstonev1alpha1.EtcdCluster) error
- func (bak *Server) CreateEtcdBackupByYaml(backup *backupapiv2.EtcdBackup) error
- func (bak *Server) DeleteEtcdBackup(name, namespace string) error
- func (bak *Server) Equal(cluster *kstonev1alpha1.EtcdCluster) bool
- func (bak *Server) GetEtcdBackup(name, namespace string) (*backupapiv2.EtcdBackup, error)
- func (bak *Server) SyncBackup(cluster *kstonev1alpha1.EtcdCluster) error
- func (bak *Server) UpdateEtcdBackup(backup *backupapiv2.EtcdBackup) (*backupapiv2.EtcdBackup, error)
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 ¶
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 ¶
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
Click to show internal directories.
Click to hide internal directories.