1
0
mirror of https://github.com/rancher/rke.git synced 2025-08-31 22:46:25 +00:00

Add BackupConfig Enabled flag

This commit is contained in:
moelsayed
2019-03-08 06:05:38 +02:00
committed by Alena Prokharchyk
parent efab83d804
commit 1e34a7c5fa
5 changed files with 11 additions and 8 deletions

View File

@@ -8,7 +8,7 @@ import (
"github.com/rancher/rke/log"
"github.com/rancher/rke/services"
"github.com/rancher/rke/util"
"github.com/rancher/types/apis/management.cattle.io/v3"
v3 "github.com/rancher/types/apis/management.cattle.io/v3"
"k8s.io/apimachinery/pkg/util/validation"
)
@@ -139,7 +139,8 @@ func validateServicesOptions(c *Cluster) error {
}
func validateEtcdBackupOptions(c *Cluster) error {
if c.Services.Etcd.BackupConfig != nil {
if c.Services.Etcd.BackupConfig != nil &&
c.Services.Etcd.BackupConfig.Enabled != nil && *c.Services.Etcd.BackupConfig.Enabled {
if c.Services.Etcd.BackupConfig.S3BackupConfig != nil {
if len(c.Services.Etcd.BackupConfig.S3BackupConfig.Endpoint) == 0 {
return fmt.Errorf("etcd s3 backup backend endpoint can't be empty")