1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-02 15:34:36 +00:00

add etcd s3 uploading and downloading snapshot feature

This commit is contained in:
Guangbo Chen
2018-12-13 16:46:47 +08:00
committed by Alena Prokharchyk
parent 9db25ef841
commit 9cfe5661d8
8 changed files with 204 additions and 54 deletions

View File

@@ -119,6 +119,27 @@ func validateServicesOptions(c *Cluster) error {
return fmt.Errorf("External etcd path can't be empty")
}
}
// validate etcd s3 backup backend configurations
if err := validateEtcdBackupOptions(c); err != nil {
return err
}
return nil
}
func validateEtcdBackupOptions(c *Cluster) error {
if c.Services.Etcd.BackupConfig != nil {
if c.Services.Etcd.BackupConfig.S3BackupConfig == nil {
return fmt.Errorf("etcd backup is enabled but no s3 backend is specified")
}
if len(c.Services.Etcd.BackupConfig.S3BackupConfig.Endpoint) == 0 {
return fmt.Errorf("etcd s3 backup backend endpoint can't be empty")
}
if len(c.Services.Etcd.BackupConfig.S3BackupConfig.BucketName) == 0 {
return fmt.Errorf("etcd s3 backup backend bucketName can't be empty")
}
}
return nil
}