-
Bug
-
Resolution: Done
-
Normal
-
None
-
False
-
False
-
ToDo
-
-
OADP Sprint 215, OADP Sprint 216, OADP Sprint 217, OADP Sprint 218
-
4
-
0
-
0
-
0
-
Untriaged
-
None
Resources from a backup are silently ignored if already on the hub, while the restore status marks the resources as being restored. There is no mention of resources being skipped. This gives a false confidence that the cluster you restored the data on has the same data as the old cluster. Especially if you look at the backup and rest assured by the fact that those resources are in the backup, so the assumption is that they are restored.
I looked at the velero restore code ignoring existing resources; the issue we are discussing here. What I noticed
- here it does check if the resource already exists https://github.com/vmware-tanzu/velero/blob/main/pkg/restore/restore.go#L1224
- then checks if the existing resource is identical with the one in the backup https://github.com/vmware-tanzu/velero/blob/main/pkg/restore/restore.go#L1244
- but then only processes and updates ServiceAccounts https://github.com/vmware-tanzu/velero/blob/main/pkg/restore/restore.go#L1246
- and ignores any other type of resource; interestingly enough, the default clause doesn't log the error so you can't see anything if you look at the restore log; we need this error message in the log so we know the resource did not get updated https://github.com/vmware-tanzu/velero/blob/main/pkg/restore/restore.go#L1274
This is a restore log where a ServiceAccount resource was updated based on the new restored version
time="2022-01-13T23:33:35Z" level=info msg="Attempting to restore ServiceAccount: test-vb" logSource="pkg/restore/restore.go:1264" restore=openshift-adp/restore-backup-account-6 time="2022-01-13T23:33:35Z" level=info msg="ServiceAccount abc-broker/test-vb successfully updated" logSource="pkg/restore/restore.go:1313" restore=openshift-adp/restore-backup-account-6
And this is a restore log for a placement rule resource which was ignored; looks like everything went through though, no log error
time="2022-01-13T18:27:20Z" level=info msg="Attempting to restore PlacementRule: vb-helloworld-3-placement-1" logSource="pkg/restore/restore.go:1264" restore=openshift-adp/restore-backup-vb-test-pr-1 time="2022-01-13T18:27:20Z" level=info msg="Restored 1 items out of an estimated total of 1 (estimate will change throughout the restore)" logSource="pkg/restore/restore.go:664" name=vb-helloworld-3-placement-1 namespace=vb-helloworld-ns-3 progress= resource=placementrules.apps.open-cluster-management.io restore=openshift-adp/restore-backup-vb-test-pr-1 time="2022-01-13T18:27:20Z" level=info msg="restore completed" logSource="pkg/controller/restore_controller.go:480" restore=openshift-adp/restore-backup-vb-test-pr-1