Commit Graph

2920 Commits

Author SHA1 Message Date
Lubron Zhan eda35227bb Make pkg/apis its own Go module
Extract pkg/apis into a standalone Go module with its own go.mod/go.sum,
and wire it back into the main module via a local replace directive.

Signed-off-by: Lubron Zhan <lubronzhan@gmail.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 11:09:23 -07:00
Lyndon-Li eb0aa625ce use restorePV to cover retained and non-retained case
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-22 17:33:17 +08:00
Lyndon-Li 20a0def15d add wait restorePV detach to same mode route
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-22 17:23:24 +08:00
Lyndon-Li 77520d0522 recall the way to rebind volume with restorePV
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-22 17:21:36 +08:00
Lyndon-Li a8cf6646e1 wait PV detachment before deleting PV
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-22 16:22:33 +08:00
Lyndon-Li b68aa15344 wait PV detachment before deleting PV
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-22 16:21:51 +08:00
Xun Jiang/Bruce Jiang 6e6bf8119b Merge pull request #9911 from blackpiglet/jxun/add_log_for_filtered_resources
Add log when resources are filtered out due to verbs or sub-resources.
2026-06-22 11:36:03 +08:00
lyndon-li 6b9fd2f51f Merge branch 'main' into data-mover-support-fs-type 2026-06-18 15:36:51 +08:00
Joseph Antony Vaikath 2826b98190 Fix restore finalization overwriting dynamically provisioned PV labels (#9903)
* Merge backup PV labels instead of wholesale replacement during restore finalization

Change patchDynamicPVWithVolumeInfo to merge backup labels into the
dynamically provisioned PV rather than overwriting its entire label map.
Labels already present on the new PV (e.g. topology labels set by the
provisioner) are preserved, and only missing labels from the backup are
added. This prevents stale topology labels from the source cluster from
overwriting correct values set by the target cluster's provisioner.

Update needPatch to only trigger when backup labels are absent from the
new PV, not when values differ — since differing values now intentionally
favour the dynamically provisioned PV.

Signed-off-by: Joseph <joseph@amazee.io>
Signed-off-by: Joseph <jvaikath@redhat.com>

* Add changelog

Signed-off-by: Joseph <jvaikath@redhat.com>

* Update changelog to reflect new approach

Signed-off-by: Joseph <joseph@amazee.io>
Signed-off-by: Joseph <jvaikath@redhat.com>

* Trigger CI rebuild

Signed-off-by: Joseph <joseph@amazee.io>
Signed-off-by: Joseph <jvaikath@redhat.com>

---------

Signed-off-by: Joseph <joseph@amazee.io>
Signed-off-by: Joseph <jvaikath@redhat.com>
2026-06-17 08:30:33 -04:00
lyndon-li 55eb5f2820 Clone pv on rebind (#9913)
* clone pv on rebind

Signed-off-by: Lyndon-Li <lyonghui@vmware.com>

* update fsType to cloned PV

Signed-off-by: Lyndon-Li <lyonghui@vmware.com>

* clone pv on rebind

Signed-off-by: Lyndon-Li <lyonghui@vmware.com>

* clone pv on rebind

Signed-off-by: Lyndon-Li <lyonghui@vmware.com>

---------

Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-16 17:47:21 +08:00
Lyndon-Li 180bf4836e support fsType for data mover
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-15 18:13:30 +08:00
Adam Zhang 13f06026c0 caching the call for GetNamespaceFilter
Introduces a concurrent-safe sync.Map cache to the backup Request struct
to memoize GetNamespaceFilter results. This avoids re-evaluating glob
patterns for every item, significantly improving backup performance while
preserving the original exact-match precedence logic.

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-06-15 16:18:54 +08:00
Xun Jiang 4cf33421da Add log when resources are filtered out due to verbs or sub-resources.
Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2026-06-12 14:57:26 +08:00
Xun Jiang/Bruce Jiang 02cb85ce90 Merge pull request #9890 from blackpiglet/jxun/main/bump_deps
[main] Bump some dependancies to fix CVEs and replace some inactive maintained packages.
2026-06-11 10:08:22 +08:00
lyndon-li 4c1950980a Merge pull request #9887 from Lyndon-Li/incremental-object-aware-write-at
Incremental aware object writer - writeat
2026-06-10 18:01:42 +08:00
Xun Jiang 49b670a791 Replace github.com/pkg/errors by github.com/cockroachdb/errors
Change errors.Cause to errors.Is, because github.com/cockroachdb/errors
New() function create a error with error stack with depth 1, but
github.com/pkg/errors's New() function create error with no depth.

Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2026-06-10 15:55:57 +08:00
Xun Jiang 981988d31b Replace github.com/joho/godotenv.
Move the needed code into Velero repository.

Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2026-06-10 15:54:17 +08:00
Xun Jiang e395b6ea6b Replace github.com/robfig/cron/v3 by github.com/netresearch/go-cron
Replace k8s.io/utils/pointer with k8s.io/utils/ptr

Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2026-06-10 15:54:17 +08:00
lyndon-li 901b1a0ed1 Merge pull request #9892 from Lyndon-Li/refactor-generic-exposer-interface
Enhance RebindVolume method for generic restore exposer
2026-06-10 15:54:16 +08:00
lyndon-li dac51be057 Merge pull request #9899 from Lyndon-Li/refactor-repo-interface
Refactor object writer interface
2026-06-10 15:35:49 +08:00
Adam Zhang 5dd4dc8e5d Merge pull request #9880 from adam-jian-zhang/backup-filters-core
implemented fine-grained backup filter policies
2026-06-10 14:01:13 +08:00
Lyndon-Li 09f842afaf refactor object writer interface
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-10 10:00:30 +08:00
Shubham Pampattiwar 92123d3d46 Skip VGS cleanup when backup did not use VolumeGroupSnapshots
Guard the cleanupStubVGSC() call in restore finalization with a check
for VolumeGroupSnapshotHandle in volumeInfo. This avoids a spurious
warning on clusters where the v1beta2 VolumeGroupSnapshotContent CRD
is not installed, since the List call would fail even though no stubs
exist to clean up.

Fixes #9882

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-06-09 10:21:55 -07:00
Lyndon-Li 0a94fbbfc5 enhance RebindVolume method for generic restore exposer
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-09 18:08:59 +08:00
Subhramit Basu dda779de65 Reject restores from backups not in a completed or partially failed phase (#9792)
Run the E2E test on kind / get-go-version (push) Failing after 1m3s
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
build-image / Build (push) Failing after 16s
Main CI / get-go-version (push) Successful in 12s
Main CI / Build (push) Failing after 36s
Trivy Nightly Scan / Trivy nightly scan (velero, main) (push) Failing after 1m41s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-aws, main) (push) Failing after 1m25s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-gcp, main) (push) Failing after 1m18s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-microsoft-azure, main) (push) Failing after 1m17s
Close stale issues and PRs / stale (push) Has started running
* Add phase check validations in restore controller

Signed-off-by: subhramit <subhramit.bb@live.in>

* Adapt existing tests

Signed-off-by: subhramit <subhramit.bb@live.in>

* Add tests

Signed-off-by: subhramit <subhramit.bb@live.in>

* Update doc

Signed-off-by: subhramit <subhramit.bb@live.in>

* Add changelog

Signed-off-by: Subhramit Basu <subhramit.bb@live.in>

* Update pkg/controller/restore_controller_test.go

Signed-off-by: Subhramit Basu <subhramit.bb@live.in>

---------

Signed-off-by: subhramit <subhramit.bb@live.in>
Signed-off-by: Subhramit Basu <subhramit.bb@live.in>
2026-06-08 16:10:32 -04:00
Adam Zhang f216f2497d address review comments regarding fallbacks
fix fallbacks in backup filter policies,
- refactor the code to start with global policies, and apply
  override if exists, and document the behaviour inline according
  to the design
- Ensure that unlisted cluster-scoped kinds properly fall back
  to global label selectors
- unlisted namespace-scoped kinds are explicitly skipped when
  evaluating policy label selectors

add test coverage for GetNamespaceFilter glob matching and ordering

Added a unit test to verify that GetNamespaceFilter correctly matches
compiled glob patterns against namespace strings, and properly honors
first-match semantics when a namespace matches multiple patterns.

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-06-08 15:50:05 +08:00
Adam Zhang a35aacfb50 Update pkg/backup/backup.go
Co-authored-by: Tiger Kaovilai <passawit.kaovilai@gmail.com>
Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-06-08 15:50:05 +08:00
Adam Zhang c8bb3af761 implement fine-grained backup filter policies
implement backup logic to support backups with
NamespacedFilterPolicies and ClusterScopedFilterPolicy

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-06-08 15:50:05 +08:00
Lyndon-Li f474e313fa incremental object aware write at
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-05 17:02:41 +08:00
Lyndon-Li 8b5db5954e Merge branch 'main' into incremental-object-aware-write-at 2026-06-05 13:31:56 +08:00
Adam Zhang 0d719f1d8a cli support for fine-grained filter policies
add cli support for NamespacedFilterPolicies and
ClusterScopedFilterPolicy

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-06-04 13:25:16 +08:00
Lyndon-Li 09bfc69d63 add totalSize to repo snapshot
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-03 13:23:08 +08:00
Lyndon-Li d435b0509e add velero-pins to repo snapshot
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-02 17:40:20 +08:00
Lyndon-Li 2e1ab5ab62 Merge branch 'main' into block-data-mover-backup-expose 2026-06-02 16:56:40 +08:00
lyndon-li 5cc0398662 Merge pull request #9864 from Lyndon-Li/node-agent-config-for-cbt-service
Add cbt service parameters to node-agent-config
2026-06-02 16:53:48 +08:00
Lyndon-Li 30960d1edd incremental aware object writer - writeat
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-02 13:10:32 +08:00
Wenkai Yin(尹文开) b7d5d84983 Merge pull request #9861 from Lyndon-Li/remove-restic-command-package
Remove restic command package
2026-06-02 12:53:57 +08:00
Adam Zhang 1318d2c5dd Merge pull request #9840 from adam-jian-zhang/legacy_filters_incompatibility_validation
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) Successful in 14s
Main CI / Build (push) Failing after 34s
validate incompatiblity with legacy filters
2026-06-02 09:42:57 +08:00
Lyndon-Li 74ffe25cbe add cbt service parameters to node-agent-config
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-01 14:43:43 +08:00
Lyndon-Li e4ecf26b33 add backup exposer for block data mover
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-05-29 11:44:25 +08:00
lyndon-li 2863f0df48 Merge branch 'main' into block-data-mover-backup-expose 2026-05-28 17:29:39 +08:00
Lyndon-Li cdf3b9ffaa add backup exposer for block data mover
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-05-28 16:13:09 +08:00
lyndon-li 89be6c01df Merge pull request #9853 from Lyndon-Li/incremental-aware-object-write
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 3s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / get-go-version (push) Successful in 12s
Main CI / Build (push) Failing after 29s
Close stale issues and PRs / stale (push) Successful in 12s
Trivy Nightly Scan / Trivy nightly scan (velero, main) (push) Failing after 1m50s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-aws, main) (push) Failing after 1m23s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-gcp, main) (push) Failing after 1m20s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-microsoft-azure, main) (push) Failing after 1m20s
Incremental aware object write
2026-05-28 14:55:36 +08:00
Lyndon-Li 0a7e5d600b remove restic command package
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-05-28 14:41:54 +08:00
Lyndon-Li 44eaea8faf incremental aware object writer - write
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-05-28 14:30:11 +08:00
Xun Jiang 8bca779270 Implement the CBT service.
* Update go.mod
* Init CBT service in velero data-mover backup/restore CLI.
* Call exeternal-snapshot-metadata's iterator library code to implement the CBT.

Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2026-05-27 14:59:16 +08:00
Adam Zhang b29185a62d validate incompatibility with legacy filters
Legacy filters should not be co-exist with new filters defined in
resource policies,
- ClusterScopedFilterPolicy
- NamespacedFilterPolicy

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

add test cases to cover positive scenario

add test case to cover the scenario that backup can
complete successfully with namespacedFilterPolicies
and clusterScopedFilterPolicy.

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-05-23 12:39:10 +08:00
lyndon-li 57c4c6fc99 Merge branch 'main' into incremental-aware-object-writer 2026-05-22 17:32:49 +08:00
Lyndon-Li 596e774582 add incremental aware object writer
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-05-22 16:36:41 +08:00
Lyndon-Li 219975bee0 Merge branch 'main' into incremental-aware-object-writer 2026-05-22 15:43:45 +08:00