Repository: apecloud/kubeblocks

Issue:
[BUG]Restore job's `apps.kubeblocks.io/pod-name` label did not respect InstanceTemplate and ordinals
**Describe the bug**
Restore job's `apps.kubeblocks.io/pod-name` label did not respect InstanceTemplate and ordinals.

1. pod name does not respect InstanceTemplate

<img width="1496" height="896" alt="Image" src="https://github.com/user-attachments/assets/8350ac9f-29ac-4e08-8da9-4c64bf2c598c" />

2. pod name's ordinal does not match pvc's ordinal

<img width="1784" height="1588" alt="Image" src="https://github.com/user-attachments/assets/cf900eb4-5ac1-4882-a903-dfdfb0a22ab6" />

 
**To Reproduce**
Using cluster yaml likes below:
```
apiVersion: apps.kubeblocks.io/v1
kind: Cluster
metadata:
  annotations:
    kubeblocks.io/crd-api-version: apps.kubeblocks.io/v1
    # kubeblocks.io/restore-from-backup: '{"mysql":{"encryptedSystemAccounts":"abc","name":"t-vip-mysql57-xaz-backup-qz4nw","namespace":"thomas-demo","volumeRestorePolicy":"Parallel"}}'
    kubeblocks.io/restore-from-backup: '{"mysql":{"encryptedSystemAccounts":"abc","name":"t-vip-mysql57-xaz-backup-qz4nw","namespace":"thomas-demo","volumeRestorePolicy":"Serial"}}'
  name: mysql57-restore
  namespace: thomas-demo
spec:
  clusterDef: vip-mysql
  componentSpecs:
  - componentDef: vip-mysql-5.7-1.0.0-alpha.0
    instanceUpdateStrategy:
      type: OnDelete
    instances:
    - annotations:
        tpl: q9n0
      name: q9n0
      ordinals:
        ranges:
        - end: 299
          start: 0
      replicas: 2
    - annotations:
        tpl: iph1
      name: iph1
      ordinals:
        ranges:
        - end: 599
          start: 300
      replicas: 1
    - annotations:
        tpl: wte2
      name: wte2
      ordinals:
        ranges:
        - end: 899
          start: 600
      replicas: 2
    name: mysql
    persistentVolumeClaimRetentionPolicy:
      whenDeleted: Delete
      whenScaled: Retain
    replicas: 5
    resources:
      limits:
        cpu: "2"
        memory: 4G
      requests:
        cpu: "2"
        memory: 4G
    # serviceVersion: 5.7.44-vip.1
    volumeClaimTemplates:
    - name: data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 10G
        # storageClassName: open-local-lvm
  terminationPolicy: Delete
  # topology: replset
```

**Expected behavior**
Restore job's pod label should respect InstanceTemplate and pvc ordinals

**Desktop (please complete the following information):**
 - KB: 1.0.1-beta.7



Hints from issue comments:

Solution patch:
diff --git a/pkg/dataprotection/restore/manager.go b/pkg/dataprotection/restore/manager.go
index 8aa7e8171..772085682 100644
--- a/pkg/dataprotection/restore/manager.go
+++ b/pkg/dataprotection/restore/manager.go
@@ -362,7 +362,7 @@ func addItsManagingLabels(claim *dpv1alpha1.RestoreVolumeClaim, index int) {
 	intctrlutil.MergeMetadataMapInplace(itsMatchLabels, &claim.Labels)
 
 	if claim.Labels[constant.KBAppPodNameLabelKey] == "" {
-		templateName, exist := claim.Labels[constant.KBAppInstanceTemplateLabelKey]
+		templateName, exist := claim.Labels[constant.KBAppComponentInstanceTemplateLabelKey]
 		var podName string
 		if exist {
 			podName = fmt.Sprintf("%s-%s-%d", compObjName, templateName, index)



Test patch:
diff --git a/pkg/dataprotection/restore/manager_test.go b/pkg/dataprotection/restore/manager_test.go
index 19078fa7e..4b1d32cf3 100644
--- a/pkg/dataprotection/restore/manager_test.go
+++ b/pkg/dataprotection/restore/manager_test.go
@@ -265,9 +265,9 @@ var _ = Describe("RestoreManager Test", func() {
 			restoreMGR, backupSet := initResources(reqCtx, startingIndex, false, func(f *testdp.MockRestoreFactory) {
 				f.SetVolumeClaimsTemplate(testdp.MysqlTemplateName, testdp.DataVolumeName,
 					testdp.DataVolumeMountPath, "", int32(replicas), int32(startingIndex), map[string]string{
-						constant.AppInstanceLabelKey:           instanceName,
-						constant.KBAppComponentLabelKey:        cmpName,
-						constant.KBAppInstanceTemplateLabelKey: templateName,
+						constant.AppInstanceLabelKey:                    instanceName,
+						constant.KBAppComponentLabelKey:                 cmpName,
+						constant.KBAppComponentInstanceTemplateLabelKey: templateName,
 					})
 			})
 			By(fmt.Sprintf("test BuildPrepareDataJobs function, expect job label pod name contains template '%s' and ordinal correct", templateName))