Commit Graph

2640 Commits

Author SHA1 Message Date
Shubham Pampattiwar
07f30d06b9 Track actual resource names for GenerateName in restore status
When restoring resources with GenerateName, Kubernetes assigns the actual name
after creation, but Velero only tracked the original name from the backup in
itemKey. This caused volume information collection to fail when trying to fetch
PVCs using the original name instead of the actual created name.

Example:
- Original PVC name from backup: "test-vm-disk-1"
- Actual created PVC name: "test-vm-backup-2025-10-27-test-vm-disk-1-mdjkd"
- Volume info tried to fetch: "test-vm-disk-1" → Failed with "not found"

This affects any plugin or workflow using GenerateName during restore:
- kubevirt-velero-plugin (VMFR use case with PVC collision avoidance)
- Custom restore item actions using generateName
- Secrets/ConfigMaps restored with generateName

Changes:
1. Add createdName field to restoredItemStatus struct (pkg/restore/request.go)
2. Capture actual name from createdObj.GetName() (pkg/restore/restore.go:1520)
3. Use createdName in RestoredResourceList() when available (pkg/restore/request.go:93-95)

This fix is backwards compatible:
- createdName defaults to empty string
- When empty, falls back to itemKey.name (original behavior)
- Only populated for GenerateName resources where needed

Fixes volume information collection errors like:
"Failed to get PVC" error="persistentvolumeclaims \"<original-name>\" not found"

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2025-10-27 12:04:46 -07:00
Lyndon-Li
d4147e406b snapshot size in restore CRs
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2025-10-27 04:41:04 +00:00
Lyndon-Li
6dbe772590 snapshot size in restore CRs only
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2025-10-22 12:41:41 +08:00
Lyndon-Li
903ee21f31 Merge branch 'main' into snapshot-size-support 2025-10-21 16:47:16 +08:00
Wenkai Yin(尹文开)
53e99556ad Merge pull request #9291 from Lyndon-Li/dont-connect-repo-in-repo-controller
Some checks failed
Run the E2E test on kind / get-go-version (push) Failing after 55s
Run the E2E test on kind / build (push) Has been skipped
Run the E2E test on kind / setup-test-matrix (push) Successful in 2s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / get-go-version (push) Failing after 9s
Main CI / Build (push) Has been skipped
Close stale issues and PRs / stale (push) Successful in 9s
Trivy Nightly Scan / Trivy nightly scan (velero, main) (push) Failing after 1m16s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-aws, main) (push) Failing after 1m7s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-gcp, main) (push) Failing after 52s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-microsoft-azure, main) (push) Failing after 47s
Don't connect repo in repo controller
2025-10-21 16:10:20 +08:00
Lyndon-Li
166f50d776 add snapshot size to data mover CRs
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2025-10-21 15:14:38 +08:00
Lyndon-Li
7cec76e445 Merge branch 'main' into cache-dir-to-vgdp 2025-10-17 17:58:01 +08:00
lyndon-li
2a5804b595 Merge branch 'main' into deprecate-pvc-node-selection 2025-10-17 13:31:21 +08:00
lyndon-li
b9af3a1947 Merge branch 'main' into dont-connect-repo-in-repo-controller 2025-10-17 13:31:11 +08:00
lyndon-li
9a3fabbc55 issue 9332: make bytesDone correct for incremental backup (#9333)
Some checks failed
Run the E2E test on kind / get-go-version (push) Failing after 58s
Run the E2E test on kind / build (push) Has been skipped
Run the E2E test on kind / setup-test-matrix (push) Successful in 2s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / get-go-version (push) Failing after 8s
Main CI / Build (push) Has been skipped
Close stale issues and PRs / stale (push) Successful in 10s
Trivy Nightly Scan / Trivy nightly scan (velero, main) (push) Failing after 1m18s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-aws, main) (push) Failing after 50s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-gcp, main) (push) Failing after 47s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-microsoft-azure, main) (push) Failing after 48s
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2025-10-16 12:41:21 -04:00
lyndon-li
72ddfd7d78 Merge branch 'main' into deprecate-pvc-node-selection 2025-10-14 14:40:40 +08:00
lyndon-li
18260d88ca Merge branch 'main' into dont-connect-repo-in-repo-controller 2025-10-14 14:40:21 +08:00
lyndon-li
e6aab8ca93 add events to diagnose (#9296)
Some checks failed
Run the E2E test on kind / get-go-version (push) Failing after 1m10s
Run the E2E test on kind / build (push) Has been skipped
Run the E2E test on kind / setup-test-matrix (push) Successful in 3s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / get-go-version (push) Failing after 16s
Main CI / Build (push) Has been skipped
Close stale issues and PRs / stale (push) Successful in 11s
Trivy Nightly Scan / Trivy nightly scan (velero, main) (push) Failing after 1m43s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-aws, main) (push) Failing after 1m5s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-gcp, main) (push) Failing after 1m2s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-microsoft-azure, main) (push) Failing after 1m2s
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2025-10-09 14:13:43 -04:00
Xun Jiang/Bruce Jiang
f8938e7fed VerifyJSONConfigs verify every elements in Data. (#9302)
Some checks failed
Run the E2E test on kind / get-go-version (push) Failing after 48s
Run the E2E test on kind / build (push) Has been skipped
Run the E2E test on kind / setup-test-matrix (push) Successful in 2s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / get-go-version (push) Failing after 4s
Main CI / Build (push) Has been skipped
Close stale issues and PRs / stale (push) Failing after 6s
Trivy Nightly Scan / Trivy nightly scan (velero, main) (push) Failing after 7s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-aws, main) (push) Failing after 3s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-gcp, main) (push) Failing after 3s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-microsoft-azure, main) (push) Failing after 4s
Add error message in the velero install CLI output if VerifyJSONConfigs fail.
Only allow one element in node-agent-configmap's Data.

Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2025-09-29 15:08:05 -04:00
Scott Seago
4ade8cf8a2 Add option for privileged fs-backup pod
Signed-off-by: Scott Seago <sseago@redhat.com>
2025-09-25 15:38:39 -04:00
Lyndon-Li
78ddeef96c add cache dir to VGDP
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2025-09-25 18:19:23 +08:00
lyndon-li
c90856de65 Merge branch 'main' into dont-connect-repo-in-repo-controller 2025-09-23 16:12:09 +08:00
Lyndon-Li
a0aac09f0a don't connect repo in repo controller
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2025-09-23 16:11:24 +08:00
lyndon-li
031df8d5e0 Merge branch 'main' into deprecate-pvc-node-selection 2025-09-23 11:46:00 +08:00
lyndon-li
21691451e9 Merge branch 'main' into backup-pvc-to-different-node 2025-09-23 11:43:24 +08:00
lyndon-li
37df853a99 Merge branch 'main' into deprecate-pvc-node-selection 2025-09-23 11:39:05 +08:00
lyndon-li
d545ad49ba Merge branch 'main' into main 2025-09-23 11:10:38 +08:00
0xLeo258
1ebe357d18 Add built-in mutex for SynchronizedVSList && Update unit tests
Signed-off-by: 0xLeo258 <noixe0312@gmail.com>
2025-09-20 09:13:07 +08:00
0xLeo258
f2a27c3864 fix9247: Protect VolumeSnapshot field
Signed-off-by: 0xLeo258 <noixe0312@gmail.com>
2025-09-20 09:13:07 +08:00
0xLeo258
e21b21c19e fix 9234: Add safe VolumeSnapshotterCache
Signed-off-by: 0xLeo258 <noixe0312@gmail.com>
2025-09-18 17:21:25 +08:00
lyndon-li
112bea520e Merge branch 'main' into deprecate-pvc-node-selection 2025-09-17 15:19:40 +08:00
Lyndon-Li
7e15e9ba05 deprecate pvc node selection
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2025-09-17 15:09:54 +08:00
Shubham Pampattiwar
59289fba76 Fix Schedule Backup Queue Accumulation During Extended Blocking Scenarios
Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2025-09-15 16:01:33 -07:00
Wenkai Yin(尹文开)
925479553a Merge pull request #9256 from shubham-pampattiwar/inhrerit-tolr-jobs
Some checks failed
Run the E2E test on kind / build (push) Failing after 9s
Run the E2E test on kind / setup-test-matrix (push) Successful in 2s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / Build (push) Failing after 3s
Close stale issues and PRs / stale (push) Failing after 4m11s
Trivy Nightly Scan / Trivy nightly scan (velero, main) (push) Failing after 1m1s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-aws, main) (push) Failing after 4s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-gcp, main) (push) Failing after 4s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-microsoft-azure, main) (push) Failing after 5s
Fix maintenance jobs toleration inheritance from Velero deployment
2025-09-15 14:49:21 +08:00
lyndon-li
47340e67af Merge branch 'main' into backup-pvc-to-different-node 2025-09-12 13:30:34 +08:00
Lyndon-Li
25a7ef0e87 backupPVC to different node
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2025-09-12 13:27:58 +08:00
lyndon-li
799d596d5c Merge pull request #9226 from sseago/iba-perf
Some checks failed
Run the E2E test on kind / build (push) Failing after 5s
Run the E2E test on kind / setup-test-matrix (push) Successful in 2s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / Build (push) Failing after 4s
Close stale issues and PRs / stale (push) Failing after 2m10s
Trivy Nightly Scan / Trivy nightly scan (velero, main) (push) Failing after 39s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-aws, main) (push) Failing after 6s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-gcp, main) (push) Failing after 5s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-microsoft-azure, main) (push) Failing after 6s
Get pod list once per namespace in pvc IBA
2025-09-12 10:55:43 +08:00
Shubham Pampattiwar
5ba00dfb09 Fix maintenance jobs toleration inheritance from Velero deployment
Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>

fix codespell and add changelog file

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2025-09-11 16:04:26 -07:00
lyndon-li
aad9dd9068 Merge branch 'main' into backup-pvc-to-different-node 2025-09-11 14:47:35 +08:00
Lyndon-Li
81c5b6692d backupPVC to different node
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2025-09-11 13:04:24 +08:00
Xun Jiang
e8208097ba Bump k8s library to v1.33.
Replace deprecated EventExpansion method with WithContext methods.
Modify UTs.
Align the E2E ginkgo CLI version with go.mod

Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2025-09-10 17:58:38 +08:00
Scott Seago
2a9203f1b2 Get pod list once per namespace in pvc IBA
Signed-off-by: Scott Seago <sseago@redhat.com>
2025-09-09 13:19:06 -04:00
weeix
80da461458 clarify VolumeSnapshotClass error for mismatched driver/provisioner
Signed-off-by: weeix <weeix@users.noreply.github.com>
2025-09-02 18:31:13 -05:00
Clément Nussbaumer
c5b70b4a0d test: fix backuppvc annotations test case
Signed-off-by: Clément Nussbaumer <clement.nussbaumer@postfinance.ch>
2025-08-29 10:10:41 +02:00
Clément Nussbaumer
248a840918 feat: Permit specifying annotations for the BackupPVC
Signed-off-by: Clément Nussbaumer <clement.nussbaumer@postfinance.ch>
2025-08-29 10:10:41 +02:00
Xun Jiang
996d2a025f Add E2E test cases for repository maintenance job configuration.
Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2025-08-28 20:06:15 +08:00
Xun Jiang
c62a486765 Add ConfigMap parameters validation for install CLI and server start.
Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2025-08-22 20:31:38 +08:00
Xun Jiang/Bruce Jiang
3e77413897 Merge pull request #9175 from kaovilai/issue4201
Add priorityclasses to high priority restore list
2025-08-18 15:58:31 +08:00
Priyansh Choudhary
8d4203ee30 Refactor logging package structure and move context.go to kopialib/backend
Signed-off-by: Priyansh Choudhary <im1706@gmail.com>
2025-08-14 11:34:16 +05:30
Tiger Kaovilai
84b33efc2e Add priorityclasses to high priority restore list
Fixes #4201: Ensure PriorityClasses are restored before pods that
reference them, preventing restoration failures when pods depend on
custom PriorityClasses.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
2025-08-11 19:24:58 -05:00
Priyansh Choudhary
815ae8af02 Remove redundant blank lines in repo.go
Signed-off-by: Priyansh Choudhary <im1706@gmail.com>
2025-08-11 14:34:42 +05:30
Priyansh Choudhary
560df6edc3 Implement context-based logging utilities for UDM repositories
Signed-off-by: Priyansh Choudhary <im1706@gmail.com>
2025-08-11 13:42:13 +05:30
Priyansh Choudhary
c8bdf07c3a Add context logger utilities for enhanced logging support
Signed-off-by: Priyansh Choudhary <im1706@gmail.com>
2025-08-08 17:12:46 +05:30
Wenkai Yin(尹文开)
3b15cea27c Merge pull request #9165 from Lyndon-Li/issue-fix-9140
Issue 9140: add NoExecute toleration for Windows
2025-08-08 13:12:24 +08:00
Xun Jiang
ec99b50970 Remove the repository maintenance job parameters from velero server.
Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2025-08-07 23:25:22 +08:00