Commit Graph
2996 Commits
Author SHA1 Message Date
a12b373e4c Support set-based filter label selectors (#10064)
Run the E2E test on kind / setup-test-matrix (push) Successful in 3s
e2e-test-kind.yaml / extract (push) Failing after 12s
Run the E2E test on kind / get-go-version (push) Failing after 13s
Run the E2E test on kind / build (push) Skipped
Run the E2E test on kind / run-e2e-test (push) Skipped
push.yml / extract (push) Successful in 10s
Main CI / get-go-version (push) Successful in 11s
Main CI / Build (push) Failing after 25s
* 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>

---------

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
Co-authored-by: Scott Seago <sseago@redhat.com>
2026-07-24 16:03:51 -04:00
e5654fa7ed Fix flaky TestKopiaObjectWriterEx_ConcurrentAsyncErrors (#10030)
The test assumed all ten Write calls succeed before any async goroutine
stores its error, but with a mock that fails instantly a goroutine can
poison the writer mid-loop, making a later Write correctly fail fast —
a timing-dependent test failure.

Rewrite the test to assert the real-world contract instead of one
schedule: a failed async block write either fails a subsequent Write
fast or surfaces at Result, and is never lost. Add a separate
deterministic case pinning the late-error schedule, holding async
writes until all writes are queued so Result alone must report the
error.

Verified with -race -count=100.

Fixes #10029

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 15:42:36 -04:00
lyndon-liandGitHub 564d213e6b Merge pull request #10035 from HajimohammadiNet/fix-install-plugin-spacing
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 14s
Main CI / Build (push) Failing after 29s
Trim plugin image entries during install
2026-07-23 14:45:21 +08:00
Shubham PampattiwarandGitHub c676fdd03e Merge pull request #10000 from shubham-pampattiwar/fix/cleanup-stale-backup-metrics
Fix stale backupLastSuccessfulTimestamp metric after schedule deletion
2026-07-22 23:26:02 -07:00
Wenkai Yin(尹文开)andGitHub d69f6abe5c Add param to StartRestore to facilitates future expansion (#10057)
Add param to StartRestore to facilitates future expansion

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2026-07-23 10:31:42 +08:00
Shubham Pampattiwar 0f01b534c3 Remove unused collectGaugeCount, assert surviving label values
Remove the unused collectGaugeCount helper and assert specific label
values survive after each deletion using testutil.ToFloat64.

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-07-22 10:43:13 -07:00
Shubham Pampattiwar 911cc9eb9e Fix gofmt alignment in backupReconciler struct
Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-07-22 09:57:28 -07:00
Shubham Pampattiwar 4ea38216f5 Address review feedback: use DeleteLabelValues, extract resync method
Replace blanket Reset() with targeted DeleteLabelValues to avoid
briefly wiping metrics for schedules that still exist. Track known
schedules in a set and only delete stale entries on each resync.

Extract the wait.Until closure into resyncBackupMetrics() so tests
can call it directly without goroutine timing. Replace hand-rolled
collectGaugeCount helper with testutil.CollectAndCount.

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-07-22 09:17:59 -07:00
Shubham Pampattiwar b9d9dcfc38 Add integration test for updateTotalBackupMetric resync
Add a test that exercises the actual updateTotalBackupMetric goroutine
with a fake client to verify stale backupLastSuccessfulTimestamp
entries are pruned during a real resync cycle.

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-07-22 09:17:59 -07:00
Shubham Pampattiwar bfeccba0a8 Move metric reset inside List success block
Avoid clearing backupLastSuccessfulTimestamp on transient API errors.
The reset and re-set now only run when the backup List call succeeds,
so existing metric values remain stable across temporary failures.

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-07-22 09:17:59 -07:00
Shubham Pampattiwar 6ea95548d6 Remove BackupLastSuccessfulTimestampCount, use Metrics() in test
Remove the exported method that was only used in tests. Use the
existing Metrics() getter to access the gauge directly in the
backup controller test instead.

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-07-22 09:17:59 -07:00
Shubham Pampattiwar 8cf03998dd Reset backupLastSuccessfulTimestamp during periodic resync
The periodic backup metrics resync in updateTotalBackupMetric only set
backupLastSuccessfulTimestamp values but never removed stale entries.
When a schedule was deleted and its backups removed, the gauge persisted
until the Velero pod was restarted.

Reset the gauge before re-setting current values so that deleted
schedules are pruned automatically each resync cycle.

Fixes #9239

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-07-22 09:17:59 -07:00
Shubham Pampattiwar 1968bf44ee Add ResetBackupLastSuccessfulTimestamp to ServerMetrics
Add a method to reset all backupLastSuccessfulTimestamp gauge values.
This will be used by the backup controller's periodic resync to prune
stale metrics for deleted schedules.

Fixes #9239

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-07-22 09:17:59 -07:00
Xun Jiang/Bruce JiangandGitHub 36647b0b2f Merge pull request #9974 from blackpiglet/jxun/fips-140
Disable fips140 enforcement because Kopia doesn't support it.
2026-07-22 17:28:58 +08:00
Adam ZhangandGitHub d59e7d4eb8 Prioritize exact namespace match in restore (#10033)
Run the E2E test on kind / get-go-version (push) Failing after 1m12s
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 12s
Main CI / Build (push) Failing after 26s
* 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-20 09:18:13 -04:00
lyndon-liandGitHub b96bb73308 Merge pull request #10007 from Lyndon-Li/cancel-pvb-on-timeout
Issue 9997: cancel ongoing PVB on timeout
2026-07-20 16:31:16 +08:00
lyndon-liandGitHub 32242d2f0a Merge pull request #10005 from Lyndon-Li/fail-earlier-when-pvr-pod-is-not-ready
Issue 9973: fail earlier when PVR pod is not ready
2026-07-20 16:30:50 +08:00
hajimohammadi.netandGitHub 14c3c87292 Merge branch 'main' into fix-install-plugin-spacing 2026-07-19 09:59:41 +03:30
AmirHossein HajiMohammadi bd7b2ed690 Trim plugin image entries during install
Signed-off-by: AmirHossein HajiMohammadi <a.hajimohammadi@rahkar.team>
2026-07-18 17:13:54 +03:30
Shubham Pampattiwar 251272ae09 Address review feedback: update short names for Backup, BackupRepository, and DownloadRequest
- Backup: bkp -> bak (more common abbreviation)
- BackupRepository: br -> repo (avoids conflict with "backup & restore")
- DownloadRequest: dr -> dreq (avoids conflict with "disaster recovery")

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-07-17 11:44:40 -07:00
Shubham Pampattiwar deba91ab9c Add CRD short names for all Velero custom resources
Only 3 of 13 Velero CRDs had short names (bsl, vsl, ssr). This adds
short names to the remaining 10 CRDs for better kubectl usability:

  Backup=bkp, Restore=rst, Schedule=sched, BackupRepository=br,
  DeleteBackupRequest=dbr, DownloadRequest=dr, PodVolumeBackup=pvb,
  PodVolumeRestore=pvr, DataUpload=du, DataDownload=dd

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-07-17 11:42:09 -07:00
lyndon-liandGitHub a0749e7658 Block dev for restore (#10013)
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
Main CI / get-go-version (push) Successful in 13s
Main CI / Build (push) Failing after 22s
* add block dev operations for block uploader restore

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

* add block dev operations for block uploader restore

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

---------

Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-07-17 16:35:19 +08:00
Wenkai Yin(尹文开) ddac19121a Only run PVC CSI RIA for CSI snapshot
Put the checking logic at the begining to make sure only run PVC CSI RIA for CSI snapshot

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2026-07-17 13:44:41 +08:00
Chlins ZhangandGitHub 39017a205a Merge pull request #10004 from chlins/feat/data-mover-selection
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 3s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / get-go-version (push) Successful in 15s
Main CI / Build (push) Failing after 23s
feat(resourcepolicies): support dataMover parameter in snapshot volume
2026-07-16 16:54:46 +08:00
lyndon-liandGitHub b0d7ada06a Block dev for block uploader backup (#9994)
* add block dev operations for block data mover backup

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

* add block dev operations for block data mover backup

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

* Add block device operations for block uploader backup

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

* Add block device operations for block uploader backup

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

---------

Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-07-16 13:44:41 +08:00
Lyndon-Li 8ade19adfc issue 9997: cancel ongoing PVB on timeout
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-07-15 17:29:20 +08:00
Xun Jiang d82c552aaa Add BackupType in backup.spec.
Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2026-07-15 08:35:06 +00:00
chlins 666d14de32 feat(resourcepolicies): support dataMover parameter in snapshot volume policy action
Signed-off-by: chlins <chlins.zhang@gmail.com>
2026-07-15 15:26:23 +08:00
Lyndon-Li a94e01760b fail earlier when PVR pod is not ready
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-07-15 15:24:17 +08:00
Shubham PampattiwarandGitHub e593ba73f9 Fix PodVolumeBackup metadata loss on fs-backup timeout (#9995)
Run the E2E test on kind / get-go-version (push) Failing after 1m6s
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 15s
Main CI / Build (push) Failing after 24s
* 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>
2026-07-14 12:22:52 -04:00
Chlins ZhangandGitHub c825e3c136 fix(delete): surface DeleteItemAction plugin errors from InvokeDeleteActions (#9993)
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 11s
Main CI / Build (push) Failing after 21s
Signed-off-by: chlins <chlins.zhang@gmail.com>
2026-07-13 14:51:54 -07:00
Adam Zhang 8c79adde74 fix globalExcludes lookup
The kind is normalized to lower case, so should the lookup.

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-07-11 10:09:39 +08:00
Adam ZhangandGitHub 9a690cc815 Merge pull request #9946 from adam-jian-zhang/restore_filters_via_resource_policy
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 12s
Main CI / Build (push) Failing after 25s
restore filters via resource policy
2026-07-11 09:03:43 +08:00
Shubham PampattiwarandGitHub ae06d40c69 Validate user-provided labels and annotations in maintenance job (#9982)
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 13s
Main CI / Build (push) Failing after 26s
* Validate user-provided labels and annotations in maintenance job

User-provided labels and annotations from maintenance JobConfigs
are now validated before being applied to the maintenance Job pod
template. Invalid label keys, label values, and annotation keys
are skipped with a warning log. This prevents the Kubernetes API
from rejecting the entire Job when a user provides labels or
annotations that violate naming rules.

Additionally, user-provided labels can no longer overwrite the
internal RepositoryNameLabel used for job tracking.

Fixes velero-io/velero#9981

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

* Add tests for label and annotation validation in maintenance job

Add test cases to TestBuildJob covering:
- Invalid label key is skipped
- Invalid label value is skipped
- Label value exceeding 63 characters is skipped
- User-provided label cannot overwrite RepositoryNameLabel
- Invalid annotation key is skipped

Also fix a latent test issue where param.BackupRepo was not reset
between test cases, and add the missing assertion for
expectedPodAnnotation which was defined but never checked.

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

* Fix gofmt formatting in maintenance test file

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

* Add changelog for PR #9982

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

---------

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-07-10 13:00:43 -04:00
lyndon-liandGitHub 528e9fa970 Merge pull request #9979 from Lyndon-Li/block-uploader-backup-implementation
Block uploader backup implementation
2026-07-10 13:11:13 +08:00
Adam ZhangandGitHub c1cd00ff07 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-09 22:56:56 -04:00
Wenkai Yin(尹文开)andGitHub d2342532f4 Use forward slash as the path separator to make sure it works on both Linux and Windows nodes (#9968)
Run the E2E test on kind / get-go-version (push) Failing after 1m9s
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 14s
Main CI / Build (push) Failing after 25s
Use forward slash as the path separator to make sure it works on both Linux and Windows nodes

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2026-07-09 17:41:55 +08:00
Lyndon-Li 84bee82575 block uploader backup implementation
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-07-09 13:15:59 +08:00
Adam Zhang f3beea83da address review comments
- normalized the input to lower case for consistency
- added validations for kind collision
- add flag for unresolved kinds, and defer skip decision base on that
- move peek-and-map test cases to restore_policies_test.go

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-07-09 11:50:20 +08:00
Lyndon-Li ce1c1803b2 Merge branch 'main' into block-uploader-backup-implementation 2026-07-09 11:39:30 +08:00
Xun Jiang a9545d785f Disable fips140 enforcement because Kopia doesn't support it.
Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2026-07-08 17:40:43 +08:00
Adam Zhang 02b6e16088 add notes about potential data race
Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-07-08 11:48:30 +08:00
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
Xun Jiang/Bruce JiangandGitHub b9a96eec7d Merge pull request #9958 from velero-io/dependabot/go_modules/pkg/apis/golang.org/x/net-0.55.0
Run the E2E test on kind / get-go-version (push) Failing after 1m9s
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 10s
Main CI / Build (push) Failing after 2m5s
Bump golang.org/x/net from 0.49.0 to 0.55.0 in /pkg/apis
2026-07-06 11:54:48 +08:00
lyndon-liandGitHub cfbd1b6ae4 Merge pull request #9955 from sseago/vss-main
Early frequent polling for CSI snapshots to handle Windows VSS timeout
2026-07-06 11:11:52 +08:00
dependabot[bot]andGitHub daef5f5cf7 Bump golang.org/x/net from 0.49.0 to 0.55.0 in /pkg/apis
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.49.0 to 0.55.0.
- [Commits](https://github.com/golang/net/compare/v0.49.0...v0.55.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-version: 0.55.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-03 17:50:39 +00:00
Xun Jiang/Bruce JiangandGitHub 96ae6586d0 Merge pull request #9863 from blackpiglet/jxun/change-id
Support change-id and volume-id in backup workflow.
2026-07-02 11:32:15 +08:00
Scott Seagoandaider c60a5bcc7c feat: Implement early frequent polling for CSI snapshots
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
Signed-off-by: Scott Seago <sseago@redhat.com>
2026-07-01 11:56:48 -04:00
Scott Seagoandaider fa20e46016 refactor: Optimize VSC handle readiness polling for VSS backups
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
Signed-off-by: Scott Seago <sseago@redhat.com>
2026-07-01 11:00:18 -04:00
Xun Jiang 0bc06323bf Support change-id and volume-id in backup workflow.
* Add change-id and volume-id retrieve logic for both vks and vanilla k8s environment.
* Add change-id and volume-id support code in exposer.

Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2026-07-01 15:19:52 +08:00