Commit Graph
6152 Commits
Author SHA1 Message Date
Adam ZhangandGitHub ad0f74ee9d [Cherry-pick]Set based label selectors for 1.18 (#10072)
Run the E2E test on kind / setup-test-matrix (push) Successful in 3s
e2e-test-kind.yaml / extract (push) Successful in 12s
Run the E2E test on kind / get-go-version (push) Successful in 14s
push.yml / extract (push) Successful in 13s
Main CI / get-go-version (push) Successful in 14s
Run the E2E test on kind / build (push) Failing after 28s
Run the E2E test on kind / run-e2e-test (push) Skipped
Main CI / Build (push) Failing after 30s
* add documentation for backup filters (#9967)

* add documentation for backup filters

Add user guide for fine grained backup filters with examples
from easy to advanced.

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

* address review comments

- enhanced example 3, explain how each item got excluded
- enhanced example 8, explain the exact match rule, and how the
  ordering affecting namespace that has  multiple match patterns
- cross link to restore side design
- fix the error msg to be consistent with implemenation

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

---------

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

* update backup filters example 14

update the excludeNames to match example 3 for better consistency.

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

* Support set-based filter label selectors (#10064)

* Support set-based filter label selectors

Use matchLabels/matchExpressions in fine-grained filters.

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

* omit the details of resource policy for cli

The reason to not resolve and display CLI is because it may go
out of sync, we want to avoid display it to mislead users.

We may consider to cpature those information and display it
in later release.

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

* update change log

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

---------

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-07-27 15:13:40 +08:00
Adam ZhangandGitHub bf0ad2949d Merge pull request #10052 from adam-jian-zhang/prioritize-exact-ns-match-for-1.18
Run the E2E test on kind / get-go-version (push) Successful in 1m10s
Run the E2E test on kind / setup-test-matrix (push) Successful in 3s
Main CI / get-go-version (push) Successful in 11s
Run the E2E test on kind / build (push) Failing after 24s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / Build (push) Failing after 28s
[Cherry-pick]Prioritize exact namespace match in restore (#10033)
2026-07-22 14:56:56 +08:00
Adam Zhang 893000a369 update changelog id to match PR
Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-07-21 10:37:32 +08:00
Adam Zhang 202778a386 Prioritize exact namespace match in restore (#10033)
* Prioritize exact namespace match in restore

Align restore pipeline with backup pipeline by
evaluating exact namespace matches before glob
patterns in namespacedFilterPolicies. This ensures
specific overrides always win regardless of list
order.

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

* improve test cases

add test cases for exact listed first, and excat listed last to
ensure the behavior that the order does not matter for exact
listed namespace, the rule will be always honored.

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

---------

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-07-21 10:33:16 +08:00
lyndon-liandGitHub 16f0df492a issue 9997: cancel ongoing PVB on timeout (#10039)
Run the E2E test on kind / get-go-version (push) Successful in 1m1s
Run the E2E test on kind / setup-test-matrix (push) Successful in 2s
Main CI / get-go-version (push) Successful in 11s
Run the E2E test on kind / build (push) Failing after 23s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / Build (push) Failing after 21s
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-07-20 17:35:55 +08:00
Adam ZhangandGitHub 99a8590b17 Merge pull request #10015 from adam-jian-zhang/fine-grained-restore-filters-for-1.18
Run the E2E test on kind / get-go-version (push) Successful in 58s
Run the E2E test on kind / setup-test-matrix (push) Successful in 3s
Main CI / get-go-version (push) Successful in 11s
Run the E2E test on kind / build (push) Failing after 26s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / Build (push) Failing after 27s
Fine grained restore filters for 1.18
2026-07-16 15:43:16 +08:00
Adam Zhang 042f49005d consolidated change logs
Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-07-16 15:09:26 +08:00
Xun Jiang/Bruce JiangandAdam Zhang fdc22a9217 Merge pull request #9989 from adam-jian-zhang/fix-globalExcludes-lookup
fix globalExcludes lookup

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-07-16 15:01:07 +08:00
Adam Zhang e3bfce3697 add cli for create/view restore resource policies (#9966)
Added CLI for creating restore resource policies, and view
the resource policies associated with resource if present.
Only list the name of the configmap for now.

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-07-16 15:01:06 +08:00
Adam Zhang 6b34d9bf95 Merge pull request #9946 from adam-jian-zhang/restore_filters_via_resource_policy
restore filters via resource policy

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-07-16 15:01:06 +08:00
Adam Zhang 6e3f613904 Merge pull request #9939 from adam-jian-zhang/resource_policy_for_restore
add resourcePolicy on restore CRD

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-07-16 15:01:06 +08:00
Adam Zhang 3ecec1fd82 restore filter enhancement (#9924)
* restore filter enhancement

enhance restore filter with resource policies, introduce resource
policies with fine-grained control for resources in restore, both
cluster scoped resources and namespace scoped resources, with
labels, names include/exclude support with glob patterns.

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

* address review comments

- Add introductory sentence linking to the Phase 1 backup filters PR.
- Add clarification that a backup's ConfigMap may not exist on the
  target cluster because it might be on a different Velero instance.
- Remove redundant explanations about backup-specific concepts
  (volume policies, include/exclude policies).
- Remove the non-goal regarding restore-side `includeExcludePolicy`.
- Remove the "Interaction with Backup-Side Filters" section.
- Remove "Step 5" from the design, as additional items requested by
  plugins should intentionally bypass fine-grained filter checks
  (consistent with backup side Stage 2).

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

* address more review comments

- remove confusion rows regarding per-namespace kind list
- simplified CLI output to configmap name only

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

---------

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-07-16 14:42:14 +08:00
Chlins ZhangandGitHub 5675a744d9 Merge pull request #10012 from chlins/cp/global-policy
Cherry-pick for #9859 and #9858
2026-07-16 14:33:14 +08:00
chlins f28850e117 feat(backup): add global backup volume policies
Signed-off-by: chlins <chlins.zhang@gmail.com>
2026-07-16 13:31:22 +08:00
Daniel Jiangandchlins 9cc2a49791 Design for global volume policies
Add the design for global volume policies to address the requirement in
 #9858

Signed-off-by: Daniel Jiang <daniel.jiang@broadcom.com>
2026-07-16 11:27:24 +08:00
chlins 97a0375a8d feat(resourcepolicies): support PVC volume mode and access mode matching
Signed-off-by: chlins <chlins.zhang@gmail.com>
2026-07-16 11:26:41 +08:00
chlins 2190f87950 docs(volume-policy): propose PVC volume mode and access mode criteria
Signed-off-by: chlins <chlins.zhang@gmail.com>
2026-07-16 11:26:00 +08:00
Adam ZhangandGitHub 8e6fb316a2 Merge pull request #10011 from adam-jian-zhang/fine-grained-backup-filters-for-1.18
Run the E2E test on kind / get-go-version (push) Successful in 1m0s
Run the E2E test on kind / setup-test-matrix (push) Successful in 3s
Main CI / get-go-version (push) Successful in 12s
Run the E2E test on kind / build (push) Failing after 24s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / Build (push) Failing after 20s
Fine grained backup filters for 1.18
2026-07-16 11:20:49 +08:00
Adam Zhang 72b2fb2dc0 add change logs
Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-07-16 10:49:17 +08:00
Adam Zhang 0af087c19a Merge pull request #9908 from adam-jian-zhang/cache-ns-filter-lookup
caching the call for GetNamespaceFilter

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-07-16 10:45:56 +08:00
Adam Zhang 78647768c4 Merge pull request #9881 from adam-jian-zhang/backup-filters-cli
cli support for fine-grained filter policies

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-07-16 10:45:56 +08:00
Adam Zhang 837c085ea4 Merge pull request #9880 from adam-jian-zhang/backup-filters-core
implemented fine-grained backup filter policies

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-07-16 10:45:56 +08:00
Adam Zhang 385ac961e5 Merge pull request #9848 from adam-jian-zhang/namespaced-filter-policies-validation
Add validations for NamespacedFilterPolicies

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-07-16 10:45:56 +08:00
Adam Zhang fe7a7456f6 Merge pull request #9847 from adam-jian-zhang/cluster-scoped-filter-policy-validation
Add validations for ClusterScopedFilterPolicy

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-07-16 10:45:56 +08:00
Adam Zhang 38a2ebf175 Merge pull request #9840 from adam-jian-zhang/legacy_filters_incompatibility_validation
validate incompatiblity with legacy filters

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-07-16 10:45:56 +08:00
Adam Zhang 0fd77fd04c Merge pull request #9821 from adam-jian-zhang/enhance-backup-filters-interface
extend backup resource policy

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-07-16 10:45:56 +08:00
Xun Jiang/Bruce JiangandAdam Zhang 81f7a24572 Merge pull request #9783 from adam-jian-zhang/backup-filter-design
backup filter enhancement design

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-07-16 10:45:56 +08:00
Daniel JiangandGitHub a5d55474cc Add maintainers as code owners (#9998) (#10002)
Run the E2E test on kind / get-go-version (push) Successful in 1m18s
Run the E2E test on kind / setup-test-matrix (push) Successful in 3s
Main CI / get-go-version (push) Successful in 12s
Run the E2E test on kind / build (push) Failing after 25s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / Build (push) Failing after 29s
Signed-off-by: Daniel Jiang <daniel.jiang@broadcom.com>
2026-07-14 21:22:41 -04:00
Shubham PampattiwarandGitHub 2fcac2285b Merge pull request #9999 from shubham-pampattiwar/cherry-pick-9995-release-1.18
[release-1.18] Fix PodVolumeBackup metadata loss on fs-backup timeout
2026-07-14 15:01:18 -07:00
Shubham Pampattiwar ef2eb6f78a Fix changelog filename for cherry-pick PR #9999
Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-07-14 09:28:25 -07:00
Shubham Pampattiwar 89e8642d3d Fix PodVolumeBackup metadata loss on fs-backup timeout (#9995)
* Fix PodVolumeBackup metadata loss on fs-backup timeout

When a backup hits the fs-backup timeout, WaitAllPodVolumesProcessed
returned nil because PVBs were only collected from the indexer in the
done branch of the select. This discarded all PVB metadata including
already-completed PVBs, making their data unrestorable.

Move the PVB collection loop to run after the select so tracked PVBs
are always persisted regardless of timeout.

Fixes #9986

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>

* Add changelog for PR #9995

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>

* Filter non-completed PVBs in hasPodVolumeBackup

After preserving tracked PVBs on timeout, non-completed PVBs (in-progress
or with no snapshot ID) would cause hasPodVolumeBackup to return true,
leading the restore to skip the original PV and dynamically re-provision
it without any data to restore from.

Only match PVBs that are Completed with a valid SnapshotID.

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>

* Add unit tests for hasPodVolumeBackup phase filtering

Verify that hasPodVolumeBackup only matches PVBs that are Completed
with a valid SnapshotID, and rejects in-progress, failed, or
empty-snapshot PVBs.

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>

---------

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
(cherry picked from commit e593ba73f9)
2026-07-14 09:27:33 -07:00
Xun Jiang/Bruce JiangandGitHub 25402b6209 [1.18] Deprecate inactive maintained packages (#9912)
Run the E2E test on kind / get-go-version (push) Successful in 59s
Run the E2E test on kind / setup-test-matrix (push) Successful in 4s
Main CI / get-go-version (push) Successful in 14s
Run the E2E test on kind / build (push) Failing after 1m48s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / Build (push) Failing after 25s
* 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>

* Replace gopkg.in/yaml.v3 by go.yaml.in/yaml/v3

Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>

* Replace github.com/joho/godotenv.

Move the needed code into Velero repository.

Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>

* 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>

---------

Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
Signed-off-by: Xun Jiang/Bruce Jiang <59276555+blackpiglet@users.noreply.github.com>
2026-07-10 11:20:34 +08:00
Xun Jiang/Bruce JiangandGitHub c253c7fe37 Merge pull request #9940 from blackpiglet/jxun/1.18/bump_crypto_for_restic
[1.18] Bump golang.org/x/crypto to v0.52.0 for Restic.
v1.18.2 v1.18.2-rc.2
2026-06-24 14:09:49 +08:00
Xun JiangandXun Jiang/Bruce Jiang 821415cb70 Bump golang.org/x/crypto to v0.52.0 for Restic.
Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2026-06-24 13:56:47 +08:00
lyndon-liandGitHub 35afb23ba1 Merge pull request #9929 from Lyndon-Li/release-1.18
1.18.2 change-log
v1.18.2-rc.1
2026-06-18 16:01:03 +08:00
Lyndon-Li bb8160a4b1 1.18.2 change-log
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-18 15:30:17 +08:00
Xun Jiang/Bruce JiangandGitHub c8ca0670d2 Bump depedencies to fix CVEs for v1.18.2 (#9919)
* Bump depedencies to fix CVEs for v1.18.2

* Bump base image to paketobuildpacks/run-jammy-tiny:0.2.139
* Bump Golang to 1.25.11-trixie
* Bump golang.org/x/crypto to v0.53.0

Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>

* Fix GitHub action failures.

* Use helm/kind-action to replace engineerd/setup-kind
* Update MinIO Dockerfile URL

Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>

---------

Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2026-06-15 09:23:23 -04:00
Shubham PampattiwarandGitHub d0c74b477e Add external-snapshotter version requirement to VGS docs (#9909)
Document that Velero 1.18.1+ requires external-snapshotter v8.2.0 or
later for VolumeGroupSnapshot support, since Velero upgraded from
v1beta1 to v1beta2 APIs.

Relates to #9882

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-06-11 22:14:04 -04:00
Xun Jiang/Bruce JiangandGitHub b0d1e36ac1 Merge pull request #9870 from shubham-pampattiwar/fix-wildcard-ns-perf-regression
Fix backup performance regression with includedNamespaces ["*"]
2026-06-11 11:27:30 +08:00
Shubham Pampattiwar a5e3c25fc9 Fix excluded namespace objects leaking into backup with cross-namespace listing
When getNamespacesToList returns "" (cross-namespace listing), resources
from all namespaces are listed. The nsTracker.track call for each
resource's namespace would inadvertently track excluded namespaces,
causing their namespace objects to pass through filterNamespaces.

Add a ShouldInclude check before tracking a namespace from non-namespace
resources to ensure excluded namespaces are not tracked.

Add test case for includedNamespaces ["*"] with excludedNamespaces to
verify both the namespace object exclusion and resource exclusion.

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-06-10 10:04:14 -07:00
Shubham Pampattiwar ea1f23f3f6 Fix backup performance regression with includedNamespaces ["*"]
Commit 8ac8f49b5 ("Remove wildcard check from getNamespacesToList")
removed the optimization that prevented "*" from being expanded to
individual namespace names. This caused getNamespacesToList to return
all namespace names instead of "" (cross-namespace listing), resulting
in N separate API list calls per resource type instead of 1.

On clusters with many namespaces (e.g. 178 on an ACM cluster), this
means ~35,000 API calls instead of ~200, causing backups to take
18-20 minutes for just 8 items.

Restore the "*" special case in ShouldExpandWildcards so that plain
"*" is not expanded, and restore the ShouldInclude("*") check in
getNamespacesToList so that cross-namespace listing is used.

The restore fix from 8ac8f49b5 (fromBackup flag) is preserved since
restores already return false before reaching the "*" check.

Namespace exclusion continues to work correctly: the nsTracker filters
excluded namespace objects via ShouldInclude, and backupItem filters
namespace-scoped resources at line 124 of item_backupper.go.

Fixes #9869

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-06-10 10:04:14 -07:00
lyndon-liandGitHub 7ffef7609e Merge pull request #9900 from shubham-pampattiwar/cherry-pick/9896-release-1.18
[release-1.18] Skip VGS cleanup when backup did not use VolumeGroupSnapshots
2026-06-10 15:11:21 +08:00
lyndon-liandGitHub 8c7f70312e Merge branch 'release-1.18' into cherry-pick/9896-release-1.18 2026-06-10 14:05:03 +08:00
Xun Jiang/Bruce JiangandGitHub f90a37302e Merge pull request #9884 from blackpiglet/jxun/1.18/bump_dependency_packages
[1.18] Remove several deperacated or inactively maintained packages
2026-06-10 13:47:07 +08:00
Shubham Pampattiwar 8f9f9cc745 Add changelog for PR #9900
Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-06-09 22:13:07 -07:00
Shubham Pampattiwar c7c749bda8 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 22:11:59 -07:00
Xun Jiang/Bruce JiangandGitHub 80067a8863 Fix unknown containerd config version error in run-e2e-test action (#9883)
Run the E2E test on kind / get-go-version (push) Successful in 56s
Run the E2E test on kind / setup-test-matrix (push) Successful in 3s
Main CI / get-go-version (push) Successful in 13s
Run the E2E test on kind / build (push) Failing after 5m49s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / Build (push) Failing after 25s
Bump kind version to v0.32.0 to support both v2, v3, and v4 version of containerd config.

Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2026-06-04 10:06:09 -04:00
lyndon-liandGitHub 81757c272b Merge pull request #9857 from blackpiglet/jxun/1.18_n-3_upgrade_test
Run the E2E test on kind / get-go-version (push) Successful in 51s
Run the E2E test on kind / setup-test-matrix (push) Successful in 3s
Main CI / get-go-version (push) Successful in 13s
Run the E2E test on kind / build (push) Failing after 5m46s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / Build (push) Failing after 35s
Modify the e2e upgrade test to support n-1 upgrade.
2026-05-28 16:57:01 +08:00
Xun Jiang ff20d670d1 Modify the e2e upgrade test to support n-1 upgrade.
Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2026-05-28 09:29:34 +08:00
lyndon-liandGitHub a43a13b6ec Merge pull request #9842 from Lyndon-Li/release-1.18
Run the E2E test on kind / get-go-version (push) Successful in 1m5s
Run the E2E test on kind / setup-test-matrix (push) Successful in 3s
Main CI / get-go-version (push) Successful in 14s
Run the E2E test on kind / build (push) Failing after 8m12s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / Build (push) Failing after 36s
[1.18] Fix DataUploadDeleteAction creating CMs for foreign DataUploads
2026-05-22 15:48:28 +08:00