Commit Graph
3242 Commits
Author SHA1 Message Date
lyndon-liandGitHub 7e67f03796 Merge pull request #10513 from ywk253100/cli
Run the E2E test on kind / setup-test-matrix (push) Failing after 4s
Scorecard supply-chain security / Scorecard analysis (push) Skipped
e2e-test-kind.yaml / extract (push) Failing after 8s
Run the E2E test on kind / get-go-version (push) Failing after 9s
Run the E2E test on kind / build (push) Skipped
Run the E2E test on kind / run-e2e-test (push) Skipped
push.yml / extract (push) Failing after 6s
Main CI / get-go-version (push) Failing after 8s
Main CI / Build (push) Skipped
Update volume info in restore finalizing stage
2026-09-11 16:02:50 +08:00
lyndon-liandGitHub 34a9f500cc let uploader to control fallback centrally (#10523)
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-09-11 00:34:13 -04:00
Wenkai Yin (尹文开) a3d744db6a Update volume info in restore finalizing stage
Update volume info in restore finalizing stage to record info from DataDownload result

Signed-off-by: Wenkai Yin (尹文开) <wenkai.yin@broadcom.com>
2026-09-10 15:04:54 +08:00
lyndon-liandGitHub 87b45ed7fd Merge pull request #10506 from Lyndon-Li/save-source-size-to-backup
Save source size to volume info
2026-09-10 14:29:48 +08:00
lyndon-liandGitHub e8af012ac5 Merge pull request #10479 from Lyndon-Li/report-incremental-fallback
Report incremental fallback message
2026-09-10 14:29:19 +08:00
Max Freedom PollardandGitHub 4c007c0af4 Scope schedule and repo CLI list calls to the Velero namespace (#10482)
Run the E2E test on kind / setup-test-matrix (push) Failing after 4s
e2e-test-kind.yaml / extract (push) Failing after 6s
Run the E2E test on kind / get-go-version (push) Failing after 7s
Run the E2E test on kind / build (push) Skipped
Run the E2E test on kind / run-e2e-test (push) Skipped
push.yml / extract (push) Failing after 6s
Main CI / get-go-version (push) Failing after 8s
Main CI / Build (push) Skipped
Scorecard supply-chain security / Scorecard analysis (push) Skipped
* Scope schedule and repo CLI list calls to the Velero namespace

velero schedule get, velero schedule describe, velero schedule
pause/unpause and velero repo get built a ctrlclient.ListOptions with a
LabelSelector but no Namespace, so the list ran across every namespace in
the cluster. Their single-name paths in the same functions already scope
to f.Namespace(), and every sibling command (backup get, restore get,
backup describe, restore describe, snapshot-location get, schedule
delete) passes Namespace too, so the omission was an oversight rather
than intent.

The read commands print another installation's Schedules and
BackupRepositories. runPause is worse: velero schedule pause --all and
velero schedule unpause --all fetch Schedules from every namespace and
then write Spec.Paused on each, so pausing one installation's schedules
pauses every other installation's schedules as well.

Add Namespace: f.Namespace() to the four List calls:

  pkg/cmd/cli/schedule/get.go:61
  pkg/cmd/cli/schedule/describe.go:59
  pkg/cmd/cli/schedule/pause.go:114
  pkg/cmd/cli/repo/get.go:61

Neither pkg/cmd/cli/schedule nor pkg/cmd/cli/repo had any tests, so the
regression tests are new files. Each seeds a fake client with one object
in the Velero namespace and one in another-velero, and asserts the second
is neither listed, described, nor paused.

Signed-off-by: Max Freedom Pollard <272618364+MaxFreedomPollard@users.noreply.github.com>

* Add changelog for PR 10482

Signed-off-by: Max Freedom Pollard <272618364+MaxFreedomPollard@users.noreply.github.com>

---------

Signed-off-by: Max Freedom Pollard <272618364+MaxFreedomPollard@users.noreply.github.com>
2026-09-09 16:52:11 -04:00
HeonJe LeeandGitHub cbd9059f80 Fix user version priorities parsing to handle CRLF line endings (#10496)
Run the E2E test on kind / setup-test-matrix (push) Failing after 3s
e2e-test-kind.yaml / extract (push) Failing after 6s
Run the E2E test on kind / get-go-version (push) Failing after 8s
Run the E2E test on kind / build (push) Skipped
Run the E2E test on kind / run-e2e-test (push) Skipped
push.yml / extract (push) Failing after 5s
Main CI / get-go-version (push) Failing after 6s
Main CI / Build (push) Skipped
formatUserPriorities stripped only spaces, so an enableapigroupversions
ConfigMap written with CRLF line endings (common for files edited on
Windows) kept a trailing carriage return in each version string, e.g.
"v2beta1\r". versionsContain compares versions with equality, so the
user priority never matched and was silently ignored. Trim the trailing
carriage return so stored versions match again.

Signed-off-by: HeonJe LEE <lhjnano@gmail.com>
2026-09-09 10:24:42 -04:00
Lyndon-Li daed42b1d8 save source size to volume info for DU and PVB
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-09-09 17:34:17 +08:00
Lyndon-Li e0e600d715 save source size for PVB
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-09-09 16:09:08 +08:00
Lyndon-Li e52bf08c99 refactor CBT retrievement to report the concrete error
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-09-09 15:55:01 +08:00
Lyndon-Li 6b549f35b3 Merge branch 'main' into save-source-size-to-backup 2026-09-09 15:50:06 +08:00
Tiger KaovilaiandGitHub 193cfdc58f Fix datamover backup arg mismatch for CSI CBT service account name (#10318)
Run the E2E test on kind / setup-test-matrix (push) Failing after 3s
e2e-test-kind.yaml / extract (push) Failing after 6s
Run the E2E test on kind / get-go-version (push) Failing after 8s
Run the E2E test on kind / build (push) Skipped
Run the E2E test on kind / run-e2e-test (push) Skipped
push.yml / extract (push) Failing after 6s
Main CI / get-go-version (push) Failing after 8s
Main CI / Build (push) Skipped
* Fix datamover backup arg mismatch for CSI CBT service account name

The exposer built the pod command with --csi-snapshot-metadata-service-sa,
but the datamover backup command only registered --cbt-sa-name. cobra
rejects unknown flags, so the data mover pod exited immediately whenever
a dedicated CBT service account was configured -- and the reverse also
held: since the flags never matched, the SA name never actually reached
the pod, so any code path depending on it stayed unreachable.

Not limited to the block data mover: this line sits outside the
DataMoverTypeVeleroBlock gate and the cbtInfo != nil gate, so it fires
for any CSI snapshot data-movement backup.

Fix: emit --cbt-sa-name (already consumed by the backup command), naming
it consistently with the other CBT flags on the same line (--change-id,
--volume-id, --snapshot-id).

Add a regression test asserting the emitted flag string parses cleanly
against NewBackupCommand's own flag set, so the two sides can't drift
apart again without a test failure.

* Add changelog for #10318

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
2026-09-09 06:34:06 +00:00
Lyndon-Li 44f09189c2 Merge branch 'main' into report-incremental-fallback 2026-09-09 14:19:59 +08:00
Yonghui Li 9d85334d40 refactor CBT retrievement to report the concrete error
Signed-off-by: Yonghui Li <lyonghui@vmware.com>
2026-09-09 14:14:54 +08:00
Xun Jiang/Bruce JiangandGitHub c7a93be95a Add MustIncludeAdditionalItemPVCs to help track BIA added PVC's PVB creation. (#10501)
* Add MustIncludeAdditionalItemPVCs structure in backup. It's used to track PVCs returned by BIA with mustIncluded annotaion and PVC is excluded from backup by global filter.
* Modfiy the volumeHelper interface to add a parameter function for ShouldPerformFSBackup.
* Modify to support fine-grained backup filters.
* Modify according to comments. Use a read-only interface to replace the parameter function.

Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2026-09-09 14:04:57 +08:00
lyndon-liandGitHub 88da86fb67 Merge pull request #10500 from Lyndon-Li/add-id-to-repo-snapshot
Add ID to repo snapshot
2026-09-09 11:02:49 +08:00
lyndon-liandGitHub 32c918b0fa Merge pull request #10307 from kaovilai/pr-bug4-gap6
Run the E2E test on kind / setup-test-matrix (push) Failing after 3s
e2e-test-kind.yaml / extract (push) Failing after 10s
Run the E2E test on kind / get-go-version (push) Failing after 11s
Run the E2E test on kind / build (push) Skipped
Run the E2E test on kind / run-e2e-test (push) Skipped
push.yml / extract (push) Failing after 7s
Main CI / get-go-version (push) Failing after 8s
Main CI / Build (push) Skipped
Fix generic CSI changeID retrieval and honor snapshot class deletion policy for CBT retention
2026-09-09 08:36:31 +08:00
Yonghui Li 8e604b17b2 add ID to repo snapshot
Signed-off-by: Yonghui Li <lyonghui@vmware.com>
2026-09-08 18:15:34 +08:00
Yonghui Li 9fedb48e9a Merge branch 'main' into report-incremental-fallback 2026-09-08 14:11:24 +08:00
0255c6b8bf Add block data mover support for Velero backup/restore describe CLI. (#10436)
e2e-test-kind.yaml / extract (push) Failing after 10s
Run the E2E test on kind / get-go-version (push) Failing after 11s
Run the E2E test on kind / build (push) Skipped
Run the E2E test on kind / setup-test-matrix (push) Failing after 3s
Run the E2E test on kind / run-e2e-test (push) Skipped
push.yml / extract (push) Failing after 7s
Main CI / get-go-version (push) Failing after 8s
Main CI / Build (push) Skipped
* Add block data mover support for Velero backup/restore describe CLI.

Update output tests to accommodate RestoreType in VolumeInfo
This commit addresses the compilation and assertion errors caused by the introduction of `RestoreType` in `VolumeInfo` and the separation of `SnapshotDataMovementInfo` / `PodVolumeInfo` into their backup and restore counterparts. It fixes references across the test fixtures and the print guard conditions in `restore_describer.go`.

* Modify according to comments
* Add missing JSON tag in the VolumeInfo structures.
* Get uploaderType from the DU and DD's dataMover for the data mover volume info.
* Add IncrementalSize in the data mover volume info.
* Add existingVolumeDataPolicy and restoreType in the restore describe CLI output
* Add more UTs.
* Add some fields value setting that were previously missed.
* Fix the timestamp compare error only found in the GitHub action.

Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-07 14:48:41 +08:00
Lyndon-Li e1600caab3 record source size to volume info
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-09-04 19:50:45 +08:00
Lyndon-Li 6c86921876 du support source size
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-09-04 19:49:12 +08:00
Lyndon-Li d0884e7ce7 return source size from uploader
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-09-04 19:45:12 +08:00
Lyndon-Li df709d39d6 report incremental fallback message
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-09-04 17:21:57 +08:00
Lyndon-Li 9687d1e30e Merge branch 'main' into report-incremental-fallback 2026-09-04 16:15:06 +08:00
Lyndon-Li 5146992b5b add UT for progress message
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-09-04 16:04:38 +08:00
Chlins ZhangandGitHub f2ad7f081b Merge pull request #10475 from chlins/feat/inplace-preflight-check2
Run the E2E test on kind / setup-test-matrix (push) Failing after 7s
e2e-test-kind.yaml / extract (push) Failing after 7s
Run the E2E test on kind / get-go-version (push) Failing after 9s
Run the E2E test on kind / build (push) Skipped
Run the E2E test on kind / run-e2e-test (push) Skipped
push.yml / extract (push) Failing after 6s
Main CI / get-go-version (push) Failing after 7s
Main CI / Build (push) Skipped
Add in-place restore pre-flight check: PVC must be bound to the backed-up PV
2026-09-04 15:45:49 +08:00
Lyndon-Li 1048f26c20 controllers support message in progress
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-09-04 14:28:31 +08:00
Lyndon-Li 67923bca6f uploader report incremental fallback
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-09-04 14:17:28 +08:00
Lyndon-Li 7e968e10d8 UT for new bitmap implementation
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-09-04 13:48:17 +08:00
Lyndon-Li 6ec84c30f8 enhance CBT retrievement to indicate the result in error message
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-09-04 13:32:24 +08:00
31333f7610 Add structured JSON output for velero restore describe command (#9983)
Run the E2E test on kind / setup-test-matrix (push) Failing after 4s
e2e-test-kind.yaml / extract (push) Failing after 9s
Run the E2E test on kind / get-go-version (push) Failing after 10s
Run the E2E test on kind / build (push) Skipped
Run the E2E test on kind / run-e2e-test (push) Skipped
push.yml / extract (push) Failing after 5s
Main CI / get-go-version (push) Failing after 6s
Main CI / Build (push) Skipped
* Add structured JSON output for velero restore describe command

Signed-off-by: Prasad Joshi <prajoshi@redhat.com>

* Add changelog for PR 9983

Signed-off-by: Prasad Joshi <prajoshi@redhat.com>

* Fix CSI snapshot restore JSON output to distinguish snapshot vs dataMovement type

Signed-off-by: Prasad Joshi <prajoshi@redhat.com>

* Remove the redundant details wrapper key from podVolumeRestores so phase counts sit flat alongside uploaderType, matching the plaintext output structure.

Signed-off-by: Prasad Joshi <prajoshi@redhat.com>

* Add missing resourcePolicy to json struct

Signed-off-by: Prasad Joshi <prajoshi@redhat.com>

* Fix linter issue

Signed-off-by: Prasad Joshi <prajoshi@redhat.com>

* fix codecoverage

Signed-off-by: Prasad Joshi <prajoshi@redhat.com>

* Handle nil CSI snapshot fields in restore JSON describe

Signed-off-by: Prasad Joshi <prajoshi@redhat.com>

* Fix lint issue

Signed-off-by: Prasad Joshi <prajoshi@redhat.com>

---------

Signed-off-by: Prasad Joshi <prajoshi@redhat.com>
Co-authored-by: lyndon-li <98304688+Lyndon-Li@users.noreply.github.com>
Co-authored-by: Tiger Kaovilai <tkaovila@redhat.com>
2026-09-03 14:36:51 -04:00
Wenkai Yin(尹文开)andGitHub ccfdce30f9 Fall back to full restore rather than fail if fail to get the volume ID (#10465)
Run the E2E test on kind / setup-test-matrix (push) Failing after 4s
e2e-test-kind.yaml / extract (push) Failing after 7s
Run the E2E test on kind / get-go-version (push) Failing after 8s
Run the E2E test on kind / build (push) Skipped
Run the E2E test on kind / run-e2e-test (push) Skipped
push.yml / extract (push) Failing after 7s
Main CI / get-go-version (push) Failing after 8s
Main CI / Build (push) Skipped
Fall back to full restore rather than fail if fail to get the volum
e ID

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2026-09-03 14:56:35 +08:00
chlins fa717d4e48 Add in-place restore pre-flight check: PVC must be bound to the backed-up PV
An in-place restore onto a different volume than the one backed up is
unsafe: an incremental (CBT) restore computes deltas against a different
volume lineage, and even a full restore would patch and write into an
unrelated volume. Verify the existing PVC is bound and still bound to
the PV recorded at backup time before any side effect, on both the CSI
data mover path (using the backed-up PVC's volume name) and the file
system path (using the PVC-to-PV mapping from the backup volume info).

The PV comparison is skipped for namespace-mapped restores, where the
target PVC is necessarily bound to a different PV (the documented
cross-namespace clone-and-restore workflow).

Signed-off-by: chlins <chlins.zhang@gmail.com>
2026-09-03 13:59:42 +08:00
Tiger KaovilaiandGitHub 94b1ceff22 Merge branch 'main' into pr-bug4-gap6 2026-09-03 01:39:25 -04:00
Lyndon-Li a0e526768b fix shadow error problem
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-09-03 11:20:23 +08:00
Lyndon-Li 7ea7a25050 Merge branch 'main' into use-pv-topology-for-block-data-mover-for-windows 2026-09-03 11:19:11 +08:00
Chlins ZhangandGitHub 5bcac16213 Merge pull request #10464 from chlins/fix/error-message-context
Add operation context to user-facing error messages
2026-09-03 10:34:21 +08:00
Adam ZhangandGitHub 85c660612b Enforce resource filters on cluster-wide items (#10455)
Run the E2E test on kind / setup-test-matrix (push) Failing after 4s
e2e-test-kind.yaml / extract (push) Failing after 10s
Run the E2E test on kind / get-go-version (push) Failing after 11s
Run the E2E test on kind / build (push) Skipped
Run the E2E test on kind / run-e2e-test (push) Skipped
push.yml / extract (push) Failing after 6s
Main CI / get-go-version (push) Failing after 7s
Main CI / Build (push) Skipped
* Enforce resource filters on cluster-wide items

When backups query all namespaces (wildcard or omitted includes),
the item collector retrieved resources in bulk, bypassing
per-namespace resource filter policies in Stage 1 collection.
This caused resources not listed in the policy to be backed up.

To preserve cluster-wide query performance while enforcing policy
rules, evaluate namespace exclusions, resource kind allowlists,
and label selectors in memory for each collected item.

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>

* Optimize in-memory resource filter checks

Optimize per-item filter evaluation in the item collector:
- Precalculate GroupResource string once per resource type
- Skip filter policy evaluation when no namespaced policies exist
- Restrict in-memory filtering to cluster-wide queries
- Cache consecutive namespace lookups across collected items
- Lazily extract resource labels only when selectors are present

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>

---------

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-09-02 12:03:06 -04:00
chlins e03ff894ff Add operation context to user-facing error messages
Prefix raw err.Error() strings surfaced in CR statuses and CLI stderr with the failed operation.

Signed-off-by: chlins <chlins.zhang@gmail.com>
2026-09-02 15:38:36 +08:00
Xun Jiang/Bruce JiangandGitHub 51e3075e78 Merge pull request #10453 from opbot-xd/fix-ginkgo-v2-cleanup-10440
test: resolve remaining Ginkgo V2 and Gomega anti-patterns
2026-09-02 14:19:58 +08:00
Chlins ZhangandGitHub efc69c61aa Add in-place restore pre-flight check: target PVC must not be in use (#10419)
Run the E2E test on kind / setup-test-matrix (push) Failing after 4s
e2e-test-kind.yaml / extract (push) Failing after 7s
Run the E2E test on kind / get-go-version (push) Failing after 7s
Run the E2E test on kind / build (push) Skipped
Run the E2E test on kind / run-e2e-test (push) Skipped
push.yml / extract (push) Failing after 5s
Main CI / get-go-version (push) Failing after 6s
Main CI / Build (push) Skipped
Check the target PVC is not used by any active pod before any side
effect, on both the CSI data mover path and the file system path.
The in-use semantics align with the pvc-protection controller:
terminal-phase pods don't block, terminating pods block with a wait
hint. On the file system path, pods gated by this restore's
restore-wait init container (identified by the restore UID in its args,
and not yet terminated) are exempted: they must mount the PVC for the
node-agent to restore the data and cannot write to the volume until the
PodVolumeRestores complete. Leftover pods, controller-recreated pods,
and pods gated by a different restore still block.

Signed-off-by: chlins <chlins.zhang@gmail.com>
2026-09-01 17:08:25 +08:00
Wenkai Yin(尹文开)andGitHub 25b21f3c5c Get the volume ID before creating the restore PVC, otherwise the existing PV may be deleted during the creation of restore PVC (#10435)
Get the volume ID before creating the restore PVC, otherwise the existing PV may be deleted during the creation of restore PVC

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2026-09-01 15:45:22 +08:00
Wenkai Yin(尹文开)andGitHub 07768e7b33 Add "IncrementalBytes" field to status of DataDownload and PVR to indicate data transferred by the incremental restore (#10421)
Add "IncrementalBytes" field to status of DataDownload and PVR to indicate data transferred by the incremental restore

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2026-09-01 15:43:53 +08:00
Chlins ZhangandGitHub c3ccc8faf2 Merge pull request #10403 from velero-io/copilot/follow-up-pr-for-daemonset-checks
Check both daemonsets before returning non-NotFound lookup error in IsReady
2026-09-01 14:59:08 +08:00
Chlins ZhangandGitHub 0b0ac253df Merge pull request #10418 from opbot-xd/add-itemblock-unit-tests
Testing: Add missing unit tests for pkg/itemblock
2026-09-01 14:18:57 +08:00
lyndon-liandGitHub 58e788f962 Merge branch 'main' into copilot/follow-up-pr-for-daemonset-checks
Run the E2E test on kind / setup-test-matrix (push) Failing after 4s
e2e-test-kind.yaml / extract (push) Failing after 6s
Run the E2E test on kind / get-go-version (push) Failing after 12s
Run the E2E test on kind / build (push) Skipped
Run the E2E test on kind / run-e2e-test (push) Skipped
2026-09-01 13:36:50 +08:00
opbot_xd a607892eb0 test: resolve remaining Ginkgo V2 and Gomega anti-patterns (#10440)
- Replaced Expect().Should() and Expect().ShouldNot() with .To() and .ToNot() across 12 files (Task 1).
- Replaced synchronously evaluated Eventually() with Expect() in server_status_request_controller_test.go (Task 2B).
- Extracted Skip() calls inside lazy callbacks into conditional checks using slices.Contains() in enable_api_group_extentions.go (Task 3).

Signed-off-by: opbot_xd <awasthikrishna23052005@gmail.com>
2026-09-01 06:43:04 +05:30
R4mboandGitHub 7707681783 add test coverage for CleanupVolumeSnapshot (#10198)
Signed-off-by: samay43 <samayrbhat43@gmail.com>
2026-08-30 21:40:25 -04:00
Adam ZhangandGitHub edcaeff91d Merge pull request #10167 from samay43/fix/backup-name-validation
Run the E2E test on kind / setup-test-matrix (push) Failing after 7s
e2e-test-kind.yaml / extract (push) Failing after 11s
Run the E2E test on kind / get-go-version (push) Failing after 12s
Run the E2E test on kind / build (push) Skipped
Run the E2E test on kind / run-e2e-test (push) Skipped
push.yml / extract (push) Failing after 8s
Main CI / get-go-version (push) Failing after 9s
Main CI / Build (push) Skipped
validate backup name format before contacting the API server
2026-08-29 22:22:36 +08:00