Commit Graph

6340 Commits

Author SHA1 Message Date
Adam Zhang 0d6b5a4f9b add fallback for unresolved kinds via peek-and-map
When a user specifies a Custom Resource Kind in a restore filter
policy (e.g., kinds: [MyCustomKind]), the discovery helper fails
to resolve it if the CRD hasn't been restored yet.

This adds a peek-and-map fallback: if a resource type in the
backup tarball doesn't match the resolved filters, Velero peeks
at the actual Kind of the first item in the tarball and matches
it against the user's original policy strings.

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-07-08 11:18:10 +08:00
Adam Zhang b41e5df294 restore filters via resource policy
restore filters via resource policy, support ClusterScopedFilterPolicy
and NamespaceFilterPolicies.

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-06-25 17:09:57 +08:00
Adam Zhang 148f3273f2 Merge pull request #9939 from adam-jian-zhang/resource_policy_for_restore
add resourcePolicy on restore CRD
2026-06-25 16:14:51 +08:00
Adam Zhang 7529b3df6d enhance validation for restore resource policy
For resource policy in restore, it will reject invalid sections
such as volumePolicies or includeExcludePolicy, to prevent user
from misuse backup side resource policy configmap.

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-06-25 15:29:18 +08:00
Adam Zhang f8ebd8fa4b add more test cases
Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-06-25 15:29:18 +08:00
Adam Zhang ffbaceeb6d add resourcePolicy on restore CRD
Add resourcePolicy field for restore CRD which is backed by
a configmap that holds ClusterScopedFilterPolicy and
NamespacedFilterPolicies for restore side filtering.

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-06-25 15:29:18 +08:00
Chlins Zhang f0ef255c25 Merge pull request #9928 from chlins/feat/global-policy
feat(backup): add global backup volume policies
2026-06-25 15:14:34 +08:00
lyndon-li 518b55da25 Merge pull request #9942 from Lyndon-Li/clone-pv-after-deletion
Clone PV after deleting retained PV
2026-06-25 15:10:49 +08:00
Chlins Zhang bf08827426 Merge branch 'main' into feat/global-policy 2026-06-25 15:04:28 +08:00
chlins 21d67a8622 feat(backup): add global backup volume policies
Signed-off-by: chlins <chlins.zhang@gmail.com>
2026-06-25 11:31:08 +08:00
lyndon-li cfd4914123 decide restorePVC volumeMode by data mover type (#9941)
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-25 11:06:53 +08:00
Lyndon-Li 2c5dcb8474 clone PV after deleting retained PV
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-24 18:27:57 +08:00
lyndon-li 5844ce873d Merge pull request #9933 from Lyndon-Li/recall-rebind-volume-with-restore-pv-2
Recall rebind volume with restore pv
2026-06-24 17:41:56 +08:00
Lyndon-Li 6d87680ea0 Merge branch 'main' into recall-rebind-volume-with-restore-pv-2 2026-06-24 11:48:09 +08:00
Lyndon-Li 6af6e4e85f recall the way to rebind volume with restorePV
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-24 11:47:42 +08:00
Lyndon-Li 8c3a638d88 use restorePV to cover retained and non-retained case
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-24 11:47:42 +08:00
Lyndon-Li 0f9874bf06 add wait restorePV detach to same mode route
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-24 11:47:42 +08:00
Lyndon-Li 9a615430ed recall the way to rebind volume with restorePV
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-24 11:47:42 +08:00
lyndon-li 960a20f12c Merge pull request #9932 from Lyndon-Li/pv-rebind-test-2
Wait restorePV detached before binding the cloned PV
2026-06-24 11:42:52 +08:00
Adam Zhang dd5db4e863 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-06-23 21:32:07 -04:00
Lyndon-Li 04ef90dfb7 recall the way to rebind volume with restorePV
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-22 17:35:44 +08: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
lyndon-li 3b66458edd Merge branch 'main' into pv-rebind-test-2 2026-06-22 13:17:51 +08:00
Lyndon-Li d626588c10 wait PV detachment before deleting PV
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-22 13:17:26 +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 00b25fe31a Merge branch 'main' into pv-rebind-test-2 2026-06-22 11:23:12 +08:00
Lyndon-Li 22d8b4acbb wait PV detachment before deleting PV
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-22 11:21:20 +08:00
lyndon-li 8754459381 Merge pull request #9930 from Lyndon-Li/data-mover-support-fs-type
Support fsType for data mover
2026-06-22 11:12:30 +08:00
Lyndon-Li 4f22048472 support fsType for data mover
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-18 15:39:44 +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
Joseph Antony Vaikath 483becaa7b Add CONTAINER_TOOL variable to Makefile for podman support (#9904)
* Add CONTAINER_TOOL variable to Makefile for podman support

Local development targets (shell, lint, build-image, clean, serve-docs)
hardcode `docker`, preventing developers who use podman from running
them. Add a CONTAINER_TOOL variable that defaults to `docker` and can
be overridden:

  make lint CONTAINER_TOOL=podman

CI/release targets (container builds, manifest push, buildx instance
management) are left unchanged since they use Docker-specific features
like `docker buildx` and `docker manifest`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Joseph <jvaikath@redhat.com>

* Add changelog for PR #9904

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Joseph <jvaikath@redhat.com>

* Add guards to prevent podman on docker-only targets

Multi-arch image targets (container, push-manifest, etc.) require
docker buildx/manifest which podman does not support. Add explicit
guards that fail fast with a clear error message instead of producing
cryptic runtime failures.

Guarded targets: container, container-linux, container-windows,
push-manifest, push-build-image, and the buildx path in build-image.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Joseph <jvaikath@redhat.com>

* Trigger CI rebuild

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

---------

Signed-off-by: Joseph <jvaikath@redhat.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-06-17 08:29:01 -04:00
Daniel Jiang faf24ae9c1 Merge pull request #9901 from reasonerjt/bak-vol-policy-design
Design for global volume policies
2026-06-17 11:19:26 +08:00
Lyndon-Li 6a8ba4af5c support fsType for data mover
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-16 17:59:51 +08:00
lyndon-li 1e1ce4d221 bump up kopia 0.23.1 (#9923)
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-06-16 17:57:40 +08: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
Daniel Jiang 8a31544a64 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-06-16 15:16:45 +08:00
Adam Zhang 3fa00c679c Merge pull request #9908 from adam-jian-zhang/cache-ns-filter-lookup
caching the call for GetNamespaceFilter
2026-06-16 13:29:46 +08:00
Chlins Zhang afe0565201 Merge pull request #9906 from chlins/feat/pvc-volumemode-condition
feat(resourcepolicies): support PVC volume mode and access mode matching
2026-06-16 11:09:19 +08:00
Chlins Zhang 818d969b39 Merge branch 'main' into feat/pvc-volumemode-condition 2026-06-16 10:18:59 +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/Bruce Jiang 89f18122c2 Merge pull request #9917 from adam-jian-zhang/bump-kind-action
bump the setup kind action
2026-06-15 16:16:19 +08:00
chlins a191a449fb feat(resourcepolicies): support PVC volume mode and access mode matching
Signed-off-by: chlins <chlins.zhang@gmail.com>
2026-06-15 16:08:38 +08:00
Adam Zhang dd850a451c ensure the kind cluster name to "kind"
Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-06-15 15:48:43 +08:00
Adam Zhang bb3e1203df update minio DOCKFILE_SHA url
Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-06-15 15:36:22 +08:00