mirror of
https://github.com/rancher/rke.git
synced 2025-08-31 22:46:25 +00:00
Add option to pass custom CA certificate for S3 backend
This commit is contained in:
committed by
Alena Prokharchyk
parent
ffa42ab900
commit
38c31b9766
@@ -6,6 +6,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/rancher/rke/log"
|
||||
"github.com/rancher/rke/pki"
|
||||
"github.com/rancher/rke/services"
|
||||
"github.com/rancher/rke/util"
|
||||
v3 "github.com/rancher/types/apis/management.cattle.io/v3"
|
||||
@@ -147,6 +148,11 @@ func validateEtcdBackupOptions(c *Cluster) error {
|
||||
if len(c.Services.Etcd.BackupConfig.S3BackupConfig.BucketName) == 0 {
|
||||
return fmt.Errorf("etcd s3 backup backend bucketName can't be empty")
|
||||
}
|
||||
if len(c.Services.Etcd.BackupConfig.S3BackupConfig.EndpointCA) != 0 {
|
||||
if isValid, err := pki.IsValidCertStr(c.Services.Etcd.BackupConfig.S3BackupConfig.EndpointCA); !isValid {
|
||||
return fmt.Errorf("invalid S3 endpoint CA certificate: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user