Skip to content

Commit

Permalink
fix tls path error
Browse files Browse the repository at this point in the history
  • Loading branch information
shuijing198799 committed Mar 20, 2020
1 parent cc8b9d7 commit 67ade57
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions cmd/backup-manager/app/backup/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions cmd/backup-manager/app/restore/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions pkg/backup/backup/backup_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
},
})
Expand Down
8 changes: 4 additions & 4 deletions pkg/backup/restore/restore_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
},
})
Expand Down

0 comments on commit 67ade57

Please sign in to comment.