mirror of
https://github.com/rancher/rke.git
synced 2025-08-10 19:22:41 +00:00
rename EndpointCA
This commit is contained in:
parent
0a488ca453
commit
2c907f9f21
@ -148,8 +148,8 @@ func validateEtcdBackupOptions(c *Cluster) error {
|
|||||||
if len(c.Services.Etcd.BackupConfig.S3BackupConfig.BucketName) == 0 {
|
if len(c.Services.Etcd.BackupConfig.S3BackupConfig.BucketName) == 0 {
|
||||||
return fmt.Errorf("etcd s3 backup backend bucketName can't be empty")
|
return fmt.Errorf("etcd s3 backup backend bucketName can't be empty")
|
||||||
}
|
}
|
||||||
if len(c.Services.Etcd.BackupConfig.S3BackupConfig.EndpointCA) != 0 {
|
if len(c.Services.Etcd.BackupConfig.S3BackupConfig.CustomCA) != 0 {
|
||||||
if isValid, err := pki.IsValidCertStr(c.Services.Etcd.BackupConfig.S3BackupConfig.EndpointCA); !isValid {
|
if isValid, err := pki.IsValidCertStr(c.Services.Etcd.BackupConfig.S3BackupConfig.CustomCA); !isValid {
|
||||||
return fmt.Errorf("invalid S3 endpoint CA certificate: %v", err)
|
return fmt.Errorf("invalid S3 endpoint CA certificate: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ func setS3OptionsFromCLI(c *cli.Context) *v3.S3BackupConfig {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Warnf("Failed to read s3-endpoint-ca [%s]: %v", endpointCA, err)
|
logrus.Warnf("Failed to read s3-endpoint-ca [%s]: %v", endpointCA, err)
|
||||||
} else {
|
} else {
|
||||||
s3BackupBackend.EndpointCA = caStr
|
s3BackupBackend.CustomCA = caStr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return s3BackupBackend
|
return s3BackupBackend
|
||||||
|
@ -18,7 +18,7 @@ import (
|
|||||||
"github.com/rancher/rke/log"
|
"github.com/rancher/rke/log"
|
||||||
"github.com/rancher/rke/pki"
|
"github.com/rancher/rke/pki"
|
||||||
"github.com/rancher/rke/util"
|
"github.com/rancher/rke/util"
|
||||||
"github.com/rancher/types/apis/management.cattle.io/v3"
|
v3 "github.com/rancher/types/apis/management.cattle.io/v3"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
"k8s.io/client-go/util/cert"
|
"k8s.io/client-go/util/cert"
|
||||||
@ -367,8 +367,8 @@ func DownloadEtcdSnapshotFromS3(ctx context.Context, etcdHost *hosts.Host, prsMa
|
|||||||
},
|
},
|
||||||
Image: etcdSnapshotImage,
|
Image: etcdSnapshotImage,
|
||||||
}
|
}
|
||||||
if s3Backend.EndpointCA != "" {
|
if s3Backend.CustomCA != "" {
|
||||||
caStr := base64.StdEncoding.EncodeToString([]byte(s3Backend.EndpointCA))
|
caStr := base64.StdEncoding.EncodeToString([]byte(s3Backend.CustomCA))
|
||||||
imageCfg.Cmd = append(imageCfg.Cmd, "--s3-endpoint-ca="+caStr)
|
imageCfg.Cmd = append(imageCfg.Cmd, "--s3-endpoint-ca="+caStr)
|
||||||
}
|
}
|
||||||
hostCfg := &container.HostConfig{
|
hostCfg := &container.HostConfig{
|
||||||
@ -556,8 +556,8 @@ func configS3BackupImgCmd(ctx context.Context, imageCfg *container.Config, bc *v
|
|||||||
"--s3-bucketName=" + bc.S3BackupConfig.BucketName,
|
"--s3-bucketName=" + bc.S3BackupConfig.BucketName,
|
||||||
"--s3-region=" + bc.S3BackupConfig.Region,
|
"--s3-region=" + bc.S3BackupConfig.Region,
|
||||||
}...)
|
}...)
|
||||||
if bc.S3BackupConfig.EndpointCA != "" {
|
if bc.S3BackupConfig.CustomCA != "" {
|
||||||
caStr := base64.StdEncoding.EncodeToString([]byte(bc.S3BackupConfig.EndpointCA))
|
caStr := base64.StdEncoding.EncodeToString([]byte(bc.S3BackupConfig.CustomCA))
|
||||||
cmd = append(cmd, "--s3-endpoint-ca="+caStr)
|
cmd = append(cmd, "--s3-endpoint-ca="+caStr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user