Commit Graph
3045 Commits
Author SHA1 Message Date
Jay2006sawant 8ec4b22496 fix: return errors correctly in block restore validation and BatchForget
Signed-off-by: Jay2006sawant <jay242902@gmail.com>
2026-08-03 09:44:00 +05:30
lyndon-liandGitHub 0e8664a018 Merge pull request #10106 from blackpiglet/jxun/cbt_modification
Fix some issues for CBT features:
2026-08-04 16:02:11 +08:00
lyndon-liandGitHub 23a0cbe163 add incremental size for block uploader (#10151)
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-08-04 16:00:45 +08:00
Chlins ZhangandGitHub 0e16235a9b Merge pull request #10150 from chlins/fix/data-mover-drop-host-mounts
Drop node-agent host path mounts from data mover pods
2026-08-04 15:41:10 +08:00
de32d93b8e Fix ResourceDeletionStatusTracker key Kind mismatch in terminating-namespace wait (#9987)
EnsureNamespaceExistsAndIsReady wrote the tracker key with namespace.Kind
(getNamespace() sets Kind=Namespace) but read it with clusterNS.Kind
(client.Get strips TypeMeta -> Kind=empty). The keys never matched, so the
skip-path never fired and every item in a terminating namespace paid the full
--terminating-resource-timeout wait (per-resource instead of per-namespace).

Use the passed-in namespace object for Contains so Add/Contains keys match.
Add a regression test that reproduces the production Kind divergence.

Signed-off-by: Shashank1306s <shashasingh@microsoft.com>
Co-authored-by: Shashank1306s <shashasingh@microsoft.com>
Co-authored-by: Priyansh Choudhary <im1706@gmail.com>
2026-08-03 23:28:01 -07:00
Xun Jiang 11545ee63c Fix logs, CRD, and GetDataMover for CBT features.
Modify the logs.
Modify the CRD's data mover's comment.
Modify the resource policy's GetDataMover for default data mover case.

Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2026-08-04 06:25:05 +00:00
chlins bfda68ca3a Address review comments on host path exclusion
Detect the host path volumes by their source instead of their name, so the customized ones are excluded as well. Drop the container capability changes since the data mover needs them to access the data, and fix the copyright headers.

Signed-off-by: chlins <chlins.zhang@gmail.com>
2026-08-04 14:22:01 +08:00
chlins 0eec47e574 Drop node-agent host path mounts from data mover pods
The CSI snapshot and generic restore exposers access data through PVCs, so they no longer inherit the node-agent host path volumes. Also drop all capabilities on the data mover container.

Signed-off-by: chlins <chlins.zhang@gmail.com>
2026-08-04 13:48:57 +08:00
Shubham Pampattiwar b025fe3a9b Add test for DefaultResourceModifierConfigMap in AllResources
Verify the --default-resource-modifier-configmap flag is wired through
VeleroOptions to the deployment args via AllResources.

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-08-03 13:22:09 -07:00
Shubham Pampattiwar ee2c3a4cd2 Add test coverage for --skip-default-resource-modifier CLI flag
Add the flag to the existing TestCreateCommand test to verify flag
binding and option parsing.

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-08-03 13:19:48 -07:00
Shubham Pampattiwar bd95633967 Add skip log and improve test coverage
- Log when SkipDefaultResourceModifier skips the default modifier
- Add test for unsupported ResourceModifier Kind (warns, does not
  apply default)
- Add test for default ConfigMap with invalid rules (validation
  failure is non-fatal)
- loadResourceModifierConfigMap now at 100% coverage

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-08-03 13:19:48 -07:00
Shubham Pampattiwar 2be71e3c3b Add docs, example ConfigMap, describer, and review fixes
- Add Default Resource Modifiers section to restore-resource-modifiers.md
- Add --default-resource-modifier-configmap to customize-installation.md
- Add examples/default-resource-modifier-cni.yaml with CNI annotation
  stripping rules for OVN-K and Multus
- Update restore describer to show SkipDefaultResourceModifier when set
- Log warning when ResourceModifier Kind is not ConfigMap instead of
  silently doing nothing
- Add deployment_test.go coverage for the new server flag

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-08-03 13:19:48 -07:00
Shubham Pampattiwar a6f800c591 Address review feedback on default resource modifier
- Fix fallthrough bug: when ResourceModifier is set with a non-ConfigMap
  kind, do not fall through to applying the server default. The outer
  check on ResourceModifier != nil now prevents default application
  regardless of the Kind value.
- Include underlying error in fatal validation message for ConfigMap
  retrieval failures.
- Strengthen exclusive precedence test: default ConfigMap intentionally
  does not exist while per-restore does, proving the default is never
  consulted.
- Add test for invalid default ConfigMap data (non-fatal, warn and
  proceed).

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-08-03 13:19:48 -07:00
Shubham Pampattiwar c509e5369c Wire default resource modifier through install path and builder
Add --default-resource-modifier-configmap to the install CLI and
deployment builder so administrators can configure it during velero
install. Wire through VeleroOptions and podTemplateConfig following
the existing --backup-repository-configmap pattern.

Add SkipDefaultResourceModifier builder method to RestoreBuilder.

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-08-03 13:19:47 -07:00
Shubham Pampattiwar 34bc3c7e1a Add --skip-default-resource-modifier flag to restore CLI
When set, the server-configured default resource modifier is skipped
for this restore. Only sets the *bool field when the flag is true,
leaving it nil otherwise.

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-08-03 13:19:47 -07:00
Shubham Pampattiwar 8ef8ab3b1d Implement default resource modifier in restore controller
Thread DefaultResourceModifierConfigMap from server config through to
restoreReconciler. Refactor validateAndComplete to use a shared
loadResourceModifierConfigMap helper that handles both default and
per-restore ConfigMap loading.

Precedence: per-restore modifier takes exclusive precedence over the
default. Default ConfigMap errors are non-fatal (warn and proceed).
SkipDefaultResourceModifier opt-out is respected.

Includes unit tests covering: default-only, per-restore override,
skip flag, missing default (non-fatal), missing per-restore (fatal),
and no modifier configured.

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-08-03 13:19:47 -07:00
Shubham Pampattiwar 70e70f14e2 Add SkipDefaultResourceModifier field to RestoreSpec
Add *bool field following existing RestoreSpec conventions (RestorePVs,
PreserveNodePorts, IncludeClusterResources). When true, the server
default resource modifier is skipped for this restore.

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-08-03 13:19:47 -07:00
Shubham Pampattiwar f011fc4ef6 Add --default-resource-modifier-configmap server flag
Add DefaultResourceModifierConfigMap field to the server Config struct
and bind it as a CLI flag. When set, it references a ConfigMap name in
the Velero namespace containing default resource modifier rules to apply
to all restores.

Follows the existing pattern used by --backup-repository-configmap and
--repo-maintenance-job-configmap.

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2026-08-03 13:19:38 -07:00
Shubham PampattiwarandGitHub 6e511f2c80 Merge pull request #10146 from blackpiglet/jxun/modify_parent_snapshot_in_data_mover_when_is_none
Modify the ParentSnapshot to "" and ForceFull to true when ParentSnapshot is "none".
2026-08-03 09:59:48 -07:00
Xun Jiang c3ef38c225 Modify the ParentSnapshot to "" and ForceFull to true when ParentSnapshot is "none".
Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2026-08-03 18:02:36 +08:00
Lyndon-Li 1249e69999 empty sa namespace when secret is empty for getChangedBlocks
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-08-03 17:09:30 +08:00
Xun Jiang/Bruce JiangandGitHub c832bb767e Merge pull request #10142 from Lyndon-Li/upload-progerss-interval
Upload progress every 10s
2026-08-03 16:00:32 +08:00
Xun Jiang/Bruce JiangandGitHub ef95e11c8f Merge pull request #10140 from Lyndon-Li/set-cbt-service-to-uploader
Set CBT service to uploader
2026-08-03 14:35:42 +08:00
Lyndon-Li f22b7c86d7 upload progress every 10s
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-08-03 14:11:37 +08:00
Lyndon-Li 036e9944e4 empty CBT secret ns when secret is not set
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-08-03 13:52:20 +08:00
Lyndon-Li 8fe02224b9 set CBT service to uploader
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-08-03 13:25:18 +08:00
Xun Jiang f0797c9104 Use "" as parentSnapshot for DU when BackupType is incremental.
Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2026-07-31 16:24:17 +08:00
Lyndon-Li c7d7801ae9 Merge branch 'main' into optimize-sub-object-description 2026-07-29 18:09:28 +08:00
5691f7f29d Support overriding Schedule annotations via template.metadata.annotations (#10045)
Run the E2E test on kind / setup-test-matrix (push) Successful in 4s
e2e-test-kind.yaml / extract (push) Failing after 13s
Run the E2E test on kind / get-go-version (push) Failing after 14s
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 14s
Main CI / get-go-version (push) Successful in 16s
Main CI / Build (push) Failing after 2m46s
* Support overriding Schedule annotations via template.metadata.annotations

Adds an Annotations field to BackupSpec.Metadata, mirroring the existing
Labels override. When Schedule.Spec.Template.Metadata.Annotations is set,
it is used for the resulting Backup's annotations instead of copying
Schedule.Annotations directly, allowing users to opt out of unwanted
annotations (e.g. ArgoCD tracking annotations) being propagated from
Schedule to Backup.

Fixes #5836

Signed-off-by: Lubron Zhan <lubronzhan@gmail.com>

* Rename changelog fragment to match PR number 10045

Signed-off-by: Lubron Zhan <lubronzhan@gmail.com>

---------

Signed-off-by: Lubron Zhan <lubronzhan@gmail.com>
Co-authored-by: Daniel Jiang <daniel.jiang@broadcom.com>
2026-07-29 15:55:51 +08:00
Scott SeagoandGitHub 041f577343 Merge branch 'main' into fix-vsc-hardcode 2026-07-28 20:21:50 -04:00
Adam Zhang 63cfddd18d add tests to cover pvc and vsc ria
Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-07-28 16:06:04 +08:00
Lyndon-Li d685b818ad refactor block uploader thread module
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-07-28 15:43:13 +08:00
Lyndon-Li 525fb9eaa2 Merge branch 'main' into optimize-sub-object-description 2026-07-28 15:14:15 +08:00
Adam Zhang ef100da89b remove VolumeSnapshotContents from resourceMustHave list
Stop force-including VolumeSnapshotContents via resourceMustHave on
every restore; CSI VolumeSnapshot/PVC RestoreItemActions now set
`restore.velero.io/must-include-additional-items` so bound snapshot
dependencies are restored only when their parent is restored.

Fixes: #9957

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-07-28 14:04:15 +08:00
Lyndon-Li a389cb4560 Merge branch 'main' into block-uploader-thread-module-refactor 2026-07-28 13:21:28 +08:00
Lyndon-Li b635d3f8ed refactor block uploader thread module
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-07-28 13:20:34 +08:00
Adam ZhangandGitHub a43a1bce6a Add RIA must-include additional items (#10082)
Let RestoreItemActions opt in via annotation to
bypass global restore filters for AdditionalItems,
mirroring the backup-side must-include behavior.

Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
2026-07-27 16:36:55 -04:00
lyndon-liandGitHub 1711094110 Merge pull request #10071 from Lyndon-Li/block-uploader-restore-implementation
Run the E2E test on kind / setup-test-matrix (push) Successful in 3s
e2e-test-kind.yaml / extract (push) Failing after 15s
Run the E2E test on kind / get-go-version (push) Failing after 16s
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 13s
Main CI / get-go-version (push) Successful in 14s
Main CI / Build (push) Failing after 1m6s
Block uploader restore implementation
2026-07-27 15:40:52 +08:00
Xun Jiang/Bruce JiangandGitHub 3905ccb0ea Backup workflow for block data mover. (#10067)
Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2026-07-27 15:36:44 +08:00
Lyndon-Li bc596da386 block uploader restore implementation
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-07-27 14:19:22 +08:00
Lyndon-Li d81b319abf Merge branch 'main' into block-uploader-restore-implementation 2026-07-27 14:12:06 +08:00
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
Lyndon-Li 00f1626f7a block uploader restore implementation
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-07-24 14:02:19 +08:00
Lyndon-Li f6f2ecf8cc Merge branch 'main' into block-uploader-restore-implementation 2026-07-24 13:38:40 +08:00
Lyndon-Li 236c45b443 block uploader restore UT
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2026-07-24 13:37:40 +08: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