From f02d12640726cc20c61f63d87ab212916c3c19e1 Mon Sep 17 00:00:00 2001 From: BornChanger Date: Wed, 27 Sep 2023 11:01:29 +0800 Subject: [PATCH] pkg: address comments Signed-off-by: BornChanger --- pkg/backup/restore/restore_manager.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkg/backup/restore/restore_manager.go b/pkg/backup/restore/restore_manager.go index 46454fb4f38..9b6dd4d2352 100644 --- a/pkg/backup/restore/restore_manager.go +++ b/pkg/backup/restore/restore_manager.go @@ -449,11 +449,7 @@ func (rm *restoreManager) checkTiFlashAndTiKVReplicasFromBackupMeta(r *v1alpha1. } // Check volume number - if (tc.Spec.TiKV.StorageVolumes == nil && metaInfo.KubernetesMeta.TiDBCluster.Spec.TiKV.StorageVolumes != nil) || - (tc.Spec.TiKV.StorageVolumes != nil && metaInfo.KubernetesMeta.TiDBCluster.Spec.TiKV.StorageVolumes == nil) { - klog.Errorf("additional volumes # not match. either tc or backup metadata has no additional volumes, while the other has") - return fmt.Errorf("additional volumes mismatched") - } else if len(tc.Spec.TiKV.StorageVolumes) != len(metaInfo.KubernetesMeta.TiDBCluster.Spec.TiKV.StorageVolumes) { + if len(tc.Spec.TiKV.StorageVolumes) != len(metaInfo.KubernetesMeta.TiDBCluster.Spec.TiKV.StorageVolumes) { klog.Errorf("additional volumes # not match. tc has %d, and backup has %d", len(tc.Spec.TiKV.StorageVolumes), len(metaInfo.KubernetesMeta.TiDBCluster.Spec.TiKV.StorageVolumes)) return fmt.Errorf("additional volumes mismatched") }