From 67ade573ee01f42305accd3b631b5c492a721911 Mon Sep 17 00:00:00 2001 From: shuijing198799 Date: Fri, 20 Mar 2020 12:09:46 +0800 Subject: [PATCH] fix tls path error --- cmd/backup-manager/app/backup/backup.go | 6 +++--- cmd/backup-manager/app/restore/restore.go | 6 +++--- pkg/backup/backup/backup_manager.go | 8 ++++---- pkg/backup/restore/restore_manager.go | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/cmd/backup-manager/app/backup/backup.go b/cmd/backup-manager/app/backup/backup.go index 8fb99f4c89..2becef8bf6 100644 --- a/cmd/backup-manager/app/backup/backup.go +++ b/cmd/backup-manager/app/backup/backup.go @@ -46,9 +46,9 @@ func (bo *Options) backupData(backup *v1alpha1.Backup) (string, error) { } args = append(args, fmt.Sprintf("--pd=%s-pd.%s:2379", backup.Spec.BR.Cluster, clusterNamespace)) if backup.Spec.BR.TLSCluster != nil && backup.Spec.BR.TLSCluster.Enabled { - args = append(args, fmt.Sprintf("--ca=%s", path.Join(util.TiDBClientTLSPath, corev1.ServiceAccountRootCAKey))) - args = append(args, fmt.Sprintf("--cert=%s", path.Join(util.TiDBClientTLSPath, corev1.TLSCertKey))) - args = append(args, fmt.Sprintf("--key=%s", path.Join(util.TiDBClientTLSPath, corev1.TLSPrivateKeyKey))) + args = append(args, fmt.Sprintf("--ca=%s", path.Join(util.ClusterClientTLSPath, corev1.ServiceAccountRootCAKey))) + args = append(args, fmt.Sprintf("--cert=%s", path.Join(util.ClusterClientTLSPath, corev1.TLSCertKey))) + args = append(args, fmt.Sprintf("--key=%s", path.Join(util.ClusterClientTLSPath, corev1.TLSPrivateKeyKey))) } var btype string diff --git a/cmd/backup-manager/app/restore/restore.go b/cmd/backup-manager/app/restore/restore.go index 9a73e21e5f..d2e5a643d8 100644 --- a/cmd/backup-manager/app/restore/restore.go +++ b/cmd/backup-manager/app/restore/restore.go @@ -40,9 +40,9 @@ func (ro *Options) restoreData(restore *v1alpha1.Restore) error { } args = append(args, fmt.Sprintf("--pd=%s-pd.%s:2379", restore.Spec.BR.Cluster, clusterNamespace)) if restore.Spec.BR.TLSCluster != nil && restore.Spec.BR.TLSCluster.Enabled { - args = append(args, fmt.Sprintf("--ca=%s", path.Join(util.TiDBClientTLSPath, corev1.ServiceAccountRootCAKey))) - args = append(args, fmt.Sprintf("--cert=%s", path.Join(util.TiDBClientTLSPath, corev1.TLSCertKey))) - args = append(args, fmt.Sprintf("--key=%s", path.Join(util.TiDBClientTLSPath, corev1.TLSPrivateKeyKey))) + args = append(args, fmt.Sprintf("--ca=%s", path.Join(util.ClusterClientTLSPath, corev1.ServiceAccountRootCAKey))) + args = append(args, fmt.Sprintf("--cert=%s", path.Join(util.ClusterClientTLSPath, corev1.TLSCertKey))) + args = append(args, fmt.Sprintf("--key=%s", path.Join(util.ClusterClientTLSPath, corev1.TLSPrivateKeyKey))) } var restoreType string diff --git a/pkg/backup/backup/backup_manager.go b/pkg/backup/backup/backup_manager.go index 95d1881948..fa162fba9c 100644 --- a/pkg/backup/backup/backup_manager.go +++ b/pkg/backup/backup/backup_manager.go @@ -279,15 +279,15 @@ func (bm *backupManager) makeBackupJob(backup *v1alpha1.Backup) (*batchv1.Job, s volumes := []corev1.Volume{} if backup.Spec.BR.TLSCluster != nil && backup.Spec.BR.TLSCluster.Enabled { volumeMounts = append(volumeMounts, corev1.VolumeMount{ - Name: "tidb-client-tls", + Name: "cluster-client-tls", ReadOnly: true, - MountPath: util.TiDBClientTLSPath, + MountPath: util.ClusterClientTLSPath, }) volumes = append(volumes, corev1.Volume{ - Name: "tidb-client-tls", + Name: "cluster-client-tls", VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ - SecretName: util.TiDBClientTLSSecretName(backup.Spec.BR.Cluster), + SecretName: util.ClusterClientTLSSecretName(backup.Spec.BR.Cluster), }, }, }) diff --git a/pkg/backup/restore/restore_manager.go b/pkg/backup/restore/restore_manager.go index cb31a234b6..1a38b7489f 100644 --- a/pkg/backup/restore/restore_manager.go +++ b/pkg/backup/restore/restore_manager.go @@ -263,15 +263,15 @@ func (rm *restoreManager) makeRestoreJob(restore *v1alpha1.Restore) (*batchv1.Jo volumes := []corev1.Volume{} if restore.Spec.BR.TLSCluster != nil && restore.Spec.BR.TLSCluster.Enabled { volumeMounts = append(volumeMounts, corev1.VolumeMount{ - Name: "tidb-client-tls", + Name: "cluster-client-tls", ReadOnly: true, - MountPath: util.TiDBClientTLSPath, + MountPath: util.ClusterClientTLSPath, }) volumes = append(volumes, corev1.Volume{ - Name: "tidb-client-tls", + Name: "cluster-client-tls", VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ - SecretName: util.TiDBClientTLSSecretName(restore.Spec.BR.Cluster), + SecretName: util.ClusterClientTLSSecretName(restore.Spec.BR.Cluster), }, }, })