Commit Graph

6303 Commits

Author SHA1 Message Date
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 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
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
Adam Zhang 7627223d0f bump the setup kind action
update kind setup action to helm/kind-action@v1 and use
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true to suppress warning.

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-06-15 14:44:43 +08:00
lyndon-li ea9e7da301 Merge pull request #9902 from shubham-pampattiwar/docs/vgs-external-snapshotter-requirement
Add external-snapshotter version requirement to VGS docs
2026-06-11 14:15:24 +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
Shubham Pampattiwar b8a121d0b3 Add external-snapshotter version requirement to VGS docs
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-10 09:39:33 -07: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 e15e0af346 Replace gopkg.in/yaml.v3 by go.yaml.in/yaml/v3
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
Xun Jiang 90fd9706cd Bump dependencies to newer versions.
* k8s.io/klog/v2 to v2.140.0
* google.golang.org/api to v0.283.0
* github.com/aws/aws-sdk-go-v2 to v1.41.12
* github.com/aws/aws-sdk-go-v2/config to v1.32.17
* github.com/aws/aws-sdk-go-v2/feature/s3/manager to v1.22.18
* github.com/aws/aws-sdk-go-v2/service/sts to v1.42.1
* github.com/aws/smithy-go to v1.27.1
* github.com/hashicorp/go-plugin to v1.7.0
* github.com/sirupsen/logrus to v1.9.4
* github.com/vmware-tanzu/crash-diagnostics to v0.4.3

Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
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
Daniel Jiang 094f94d30f Merge pull request #9888 from chlins/design/volume-policy-pvc-volume-mode-access-modes
Design: propose PVC volume mode and access mode criteria
2026-06-10 15:02:11 +08:00
Chlins Zhang 6c6c907c6f Merge branch 'main' into design/volume-policy-pvc-volume-mode-access-modes 2026-06-10 14:46:24 +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
Chlins Zhang 5cb56f67d0 Merge branch 'main' into design/volume-policy-pvc-volume-mode-access-modes 2026-06-10 10:47:55 +08:00
chlins e431df1a34 docs(volume-policy): propose PVC volume mode and access mode criteria
Signed-off-by: chlins <chlins.zhang@gmail.com>
2026-06-10 10:44:43 +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
lyndon-li 35e974ac91 Merge pull request #9896 from shubham-pampattiwar/fix/skip-vgsc-cleanup-no-vgs
Main CI / get-go-version (push) Successful in 1m12s
Close stale issues and PRs / stale (push) Successful in 15s
Trivy Nightly Scan / Trivy nightly scan (velero, main) (push) Failing after 2m16s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-aws, main) (push) Failing after 1m44s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-gcp, main) (push) Failing after 1m24s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-microsoft-azure, main) (push) Failing after 1m21s
Main CI / Build (push) Has been cancelled
Skip VGS cleanup when backup did not use VolumeGroupSnapshots
2026-06-10 07:58:11 +08:00
Shubham Pampattiwar 22e31de11b Add changelog for PR #9896
Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-06-09 10:23:22 -07: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
Daniel Jiang 2ee99e75cd Update restore-reference.md (#9893)
This commit updates the doc to make the order of resources during
restore is consistent with the code.

Signed-off-by: Daniel Jiang <daniel.jiang@broadcom.com>
2026-06-09 09:04:25 -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
Xun Jiang/Bruce Jiang 52860f986e Use "go install" so the download goes through GOPROXY instead of the GitHub. (#9891)
Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2026-06-08 13:05:53 -07: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
Daniel Jiang 283ee24632 Merge pull request #9889 from adam-jian-zhang/bump-codecov-action
Run the E2E test on kind / get-go-version (push) Failing after 1m7s
Run the E2E test on kind / build (push) Has been skipped
Run the E2E test on kind / setup-test-matrix (push) Successful in 4s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / get-go-version (push) Successful in 13s
Main CI / Build (push) Failing after 1m2s
update codecov-action from v5 to v6
2026-06-08 15:40:47 +08:00
Adam Zhang 50ea4eea74 update codecov-action from v5 to v6
Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-06-08 11:31:37 +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
Adam Zhang 3b545b506b Merge pull request #9881 from adam-jian-zhang/backup-filters-cli
Run the E2E test on kind / get-go-version (push) Failing after 1m0s
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 13s
Main CI / Build (push) Failing after 27s
Close stale issues and PRs / stale (push) Successful in 14s
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 1m21s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-microsoft-azure, main) (push) Failing after 1m22s
cli support for fine-grained filter policies
2026-06-05 14:55:45 +08:00
Adam Zhang d46bf8a337 Merge pull request #9847 from adam-jian-zhang/cluster-scoped-filter-policy-validation
Add validations for ClusterScopedFilterPolicy
2026-06-05 14:43:22 +08:00
Lyndon-Li 8b5db5954e Merge branch 'main' into incremental-object-aware-write-at 2026-06-05 13:31:56 +08:00
Joseph Antony Vaikath b34c8436aa Remove Restic cases and workflow from E2E (#9867)
Run the E2E test on kind / get-go-version (push) Failing after 56s
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 13s
Main CI / Build (push) Failing after 26s
Close stale issues and PRs / stale (push) Successful in 12s
Trivy Nightly Scan / Trivy nightly scan (velero, main) (push) Failing after 1m39s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-aws, main) (push) Failing after 1m14s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-gcp, main) (push) Failing after 1m21s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-microsoft-azure, main) (push) Failing after 1m35s
* Remove Restic references from E2E tests and CI workflows

Rename all Restic-labeled tests to FSBackup since they test the file
system backup path, not Restic specifically. Remove dead Restic code
including VeleroUpgrade, UpdateVeleroDeployment, UpdateNodeAgent,
IsSupportUploaderType, UseResticIfFSBackup, and UploaderTypeRestic —
the server now rejects Restic as an unsupported uploader type.

Fixes #9482

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

* Add changelog for PR #9867

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

---------

Signed-off-by: Joseph <jvaikath@redhat.com>
2026-06-04 12:20:59 -04: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