Commit Graph

160 Commits

Author SHA1 Message Date
Xun Jiang
2178d36d14 Change the CreateFileToPod function's OS parameter as the E2E pass-in value.
Some checks failed
Run the E2E test on kind / build (push) Failing after 9s
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
Fix GetResourceWithLabel's bug: labels were not applied.
Add workOS for deployment and pod creationg.
Add OS label for select node.
Enlarge the context timeout to 10 minutes. 5 min is not enough for Windows.
Enlarge the Kibishii test context to 15 minutes for Windows.

Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2025-08-21 09:34:06 +08:00
Daniel Jiang
249d8f581a Add include/exclude policy to resources policy
fixes #8610

This commit extends the resources policy, such that user can define
resource include exclude filters in the policy and reuse it in different backups.

Signed-off-by: Daniel Jiang <daniel.jiang@broadcom.com>
2025-08-05 15:16:59 +08:00
Lyndon-Li
34f8b73507 bump up kopia to v0.21.1
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2025-07-22 15:56:04 +08:00
Shubham Pampattiwar
a73a150d98 Accommodate VGS workflows in PVC CSI plugin
Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>

Add changelog file

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

make update

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

lint fix

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

add unit tests for getVSForPVC func

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

Use v1beta1 instead of v1 v1alpha1

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

go mod tidy

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

update updateVGSCreatedVS func to use retry on conflict

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

make update minor fix

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

fix ut assert

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

Address PR feedback

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

minor updates

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

remove unsused func and add todo for dep upgrades

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2025-07-21 11:36:40 -07:00
Scott Seago
29a8bc4492 Mounted cloud credentials should not be world-readable (#8919)
Signed-off-by: Scott Seago <sseago@redhat.com>
2025-07-18 10:45:38 +08:00
Scott Seago
ca61b65302 Allow for proper tracking of multiple hooks per container
Signed-off-by: Scott Seago <sseago@redhat.com>
2025-06-27 16:40:15 -04:00
Xun Jiang/Bruce Jiang
b0b5cc4236 Remove dependency with VolumeSnapshotClass in DataUpload. (#9040)
Some checks failed
Run the E2E test on kind / build (push) Failing after 6m30s
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 / Build (push) Failing after 1m0s
Close stale issues and PRs / stale (push) Successful in 19s
Trivy Nightly Scan / Trivy nightly scan (velero, main) (push) Failing after 1m40s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-aws, main) (push) Failing after 1m29s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-gcp, main) (push) Failing after 1m41s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-microsoft-azure, main) (push) Failing after 1m39s
Don't add VSClass in the additionalItems when it's empty.

Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
Signed-off-by: xun.jiang <xun.jiang@broadcom.com>
2025-06-25 15:36:15 -04:00
Matthieu MOREL
07ea14962c fix require-error rule from testifylint
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-23 15:39:54 +00:00
Matthieu MOREL
59825a0506 fix len rule from testifylint
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-22 22:41:08 +02:00
Lyndon-Li
92c72b1a63 data path for vgdp ms pvb
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2025-06-03 13:25:48 +08:00
Matthieu MOREL
c6a420bd3a chore: define common aliases for k8s packages (#8672)
Some checks failed
Run the E2E test on kind / build (push) Failing after 6m48s
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 / Build (push) Failing after 35s
Close stale issues and PRs / stale (push) Successful in 8s
Trivy Nightly Scan / Trivy nightly scan (velero, main) (push) Failing after 1m11s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-aws, main) (push) Failing after 47s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-gcp, main) (push) Failing after 49s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-microsoft-azure, main) (push) Failing after 43s
* lchore: define common alias for k8s packages

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update .golangci.yaml

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update .golangci.yaml

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update .golangci.yaml

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

---------

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-04-22 06:14:47 -04:00
hu-keyu
0d27d5258f issue8720: log doesn't show pv name (#8771)
Some checks failed
Run the E2E test on kind / build (push) Failing after 6m16s
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 / Build (push) Failing after 35s
Close stale issues and PRs / stale (push) Failing after 1m14s
Trivy Nightly Scan / Trivy nightly scan (velero, main) (push) Failing after 52s
Trivy Nightly Scan / Trivy nightly scan (velero-restore-helper, main) (push) Failing after 47s
* fix: log doesn't show pv name

Signed-off-by: hu-keyu <hzldd999@gmail.com>

* fix: add changelog

Signed-off-by: hu-keyu <hzldd999@gmail.com>

* update changelog fileName

Signed-off-by: hu-keyu <hzldd999@gmail.com>

---------

Signed-off-by: hu-keyu <hzldd999@gmail.com>
2025-03-13 18:14:05 -04:00
Matthieu MOREL
6a6a237ba7 Bump golangci-lint from v1.57.2 to v1.64.5 (#8641)
Some checks failed
Run the E2E test on kind / build (push) Failing after 5m43s
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
build-image / Build (push) Failing after 8s
Main CI / Build (push) Failing after 33s
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-03-04 13:55:29 +05:30
Shubham Pampattiwar
0eb1040a0a Add labels as a criteria for volume policy (#8713)
Some checks failed
Run the E2E test on kind / build (push) Failing after 6m23s
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 / Build (push) Failing after 38s
Close stale issues and PRs / stale (push) Successful in 9s
Trivy Nightly Scan / Trivy nightly scan (velero, main) (push) Failing after 1m5s
Trivy Nightly Scan / Trivy nightly scan (velero-restore-helper, main) (push) Failing after 55s
* Add labels as a criteria for volume policy

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

add changelog file

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

handle err

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

use labels selector.matches

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

make update

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

remove fetching pvc from volume policy filtering

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

add more ut coverage

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

* minor updates

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

use VolumeFilterData struct in GetMatchAction func

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

update parsePVC func and add more ut

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

lint fix

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

---------

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2025-02-26 10:02:45 -05:00
Xun Jiang
6b7dd12bf7 Modify VS and VSC restore actions.
Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2025-02-25 10:44:45 +08:00
Xun Jiang
620a116e7f Modify CSI related DeleteItemActions.
Remove the VS DIA.
Modify the VSC DIA: create then delete the VSC.

Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2025-02-19 14:36:59 +08:00
Wenkai Yin(尹文开)
80cea31a84 Merge pull request #8694 from ywk253100/250214_hook
Some checks failed
Run the E2E test on kind / build (push) Failing after 5m44s
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 / Build (push) Failing after 36s
Close stale issues and PRs / stale (push) Successful in 7s
Trivy Nightly Scan / Trivy nightly scan (velero, main) (push) Failing after 57s
Trivy Nightly Scan / Trivy nightly scan (velero-restore-helper, main) (push) Failing after 51s
Run backup post hooks inside ItemBlock synchronously
2025-02-18 14:37:27 +08:00
Tiger Kaovilai
a3cee616dc Upgrade go.mod k8s.io/ go.mod to v0.31.3 and set klog.SetLogger() for client-go (#8450)
Some checks failed
Run the E2E test on kind / build (push) Failing after 5m44s
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 10s
Main CI / Build (push) Failing after 31s
Close stale issues and PRs / stale (push) Successful in 7s
Trivy Nightly Scan / Trivy nightly scan (velero, main) (push) Failing after 59s
Trivy Nightly Scan / Trivy nightly scan (velero-restore-helper, main) (push) Failing after 45s
Also bumped to support upgraded k8s.io/ deps.
- controller-gen to v0.16.5
- sigs.k8s.io/controller-runtime v0.19.2

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
2025-02-17 15:05:10 -05:00
Wenkai Yin(尹文开)
7aa8040c09 Run backup post hooks inside ItemBlock synchronously
Run backup post hooks inside ItemBlock synchronously as the ItemBlocks are handled asynchronously

Fixes #8516

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2025-02-17 13:27:41 +08:00
Matthieu MOREL
9010d9b13e chore: enable unnecessary-stmt from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-02-08 12:11:22 +00:00
Xun Jiang/Bruce Jiang
10a5b7b702 Merge pull request #8624 from mmorel-35/revive/use-any
chore: enable use-any from revive
2025-02-07 15:09:05 +08:00
Matthieu MOREL
1e54f1cb15 chore: enable var-declaration from revive (#8636)
Some checks failed
Run the E2E test on kind / build (push) Failing after 5m28s
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 / Build (push) Failing after 33s
Close stale issues and PRs / stale (push) Successful in 8s
Trivy Nightly Scan / Trivy nightly scan (velero, main) (push) Failing after 52s
Trivy Nightly Scan / Trivy nightly scan (velero-restore-helper, main) (push) Failing after 56s
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-01-22 15:56:44 -05:00
Matthieu MOREL
cbba3bdde7 chore: enable use-any from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-01-17 07:58:10 +01:00
Matthieu MOREL
29a77958d5 fix: dupword on tests
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-01-10 11:44:06 +01:00
Wenkai Yin(尹文开)
eb5230e12f Merge restore helper image into Velero server image
Merge restore helper image into Velero server image

Fixes #8484

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2025-01-03 14:12:23 +08:00
Wenkai Yin(尹文开)
c43fc42c25 Fix backup post hook issue
Fix backup post hook issue

Fixes #8159

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2024-12-13 12:25:45 +08:00
Wenkai Yin(尹文开)
b89270f2c1 Merge pull request #8456 from kaovilai/unused-change-struct
Some checks failed
Run the E2E test on kind / build (push) Failing after 11m29s
Run the E2E test on kind / setup-test-matrix (push) Successful in 1m37s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / Build (push) Failing after 6m14s
Close stale issues and PRs / stale (push) Failing after 11m57s
Trivy Nightly Scan / Trivy nightly scan (velero, main) (push) Failing after 11m55s
Trivy Nightly Scan / Trivy nightly scan (velero-restore-helper, main) (push) Failing after 11m54s
internal/hook/wait_exec_hook_handler_test.go: Remove unused change struct
2024-12-02 14:48:56 +08:00
Mayank Aggarwal
074f26539d Adding Support For VolumeAttributes in Resource Policy (#8383)
Some checks failed
Run the E2E test on kind / build (push) Failing after 10m15s
Run the E2E test on kind / setup-test-matrix (push) Successful in 1m15s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / Build (push) Failing after 4m47s
Close stale issues and PRs / stale (push) Failing after 11m58s
Trivy Nightly Scan / Trivy nightly scan (velero, main) (push) Failing after 11m40s
Trivy Nightly Scan / Trivy nightly scan (velero-restore-helper, main) (push) Failing after 14m53s
* Adding VolumeAttributes validations in resource policy

Signed-off-by: mayaggar <mayaggar@microsoft.com>

* adding tests

Signed-off-by: mayaggar <mayaggar@microsoft.com>

* adding tests

Signed-off-by: mayaggar <mayaggar@microsoft.com>

* adding tests

Signed-off-by: mayaggar <mayaggar@microsoft.com>

* added changelog

Signed-off-by: mayaggar <mayaggar@microsoft.com>

* changelog

Signed-off-by: mayaggar <mayaggar@microsoft.com>

* design spec

Signed-off-by: mayaggar <mayaggar@microsoft.com>

* lint fixes

Signed-off-by: mayaggar <mayaggar@microsoft.com>

* doc update

Signed-off-by: mayaggar <mayaggar@microsoft.com>

* doc update

Signed-off-by: mayaggar <mayaggar@microsoft.com>

* Update internal/resourcepolicies/volume_resources_validator.go

Co-authored-by: Tiger Kaovilai <passawit.kaovilai@gmail.com>
Signed-off-by: Mayank Aggarwal <mayankagg9722@gmail.com>

* doc name update

Signed-off-by: mayaggar <mayaggar@microsoft.com>

---------

Signed-off-by: mayaggar <mayaggar@microsoft.com>
Signed-off-by: Mayank Aggarwal <mayankagg9722@gmail.com>
Co-authored-by: Tiger Kaovilai <passawit.kaovilai@gmail.com>
2024-11-28 10:17:07 +05:30
Tiger Kaovilai
b66d7a7e0c internal/hook/wait_exec_hook_handler_test.go: Remove unused change struct
Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
2024-11-25 14:25:19 -05:00
Tiger Kaovilai
2bf98d3965 internal/volumes_information.go: reuse constants from pkg/apis/velero/v1 (#8446)
Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
2024-11-25 10:10:10 +05:30
Tiger Kaovilai
a5ef9d6f7c Typo: ebs.csi.aws.com instead of aws.ebs.csi.driver
Per driver [code](966da33cff/pkg/driver/driver.go (L49C30-L49C45))

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
2024-11-07 16:24:25 -05:00
Matthieu MOREL
226a4c1138 golangci-lint: enable and fix thelper linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-10-17 08:12:57 +02:00
Scott Seago
9d6f4d2db5 ItemBlock model and phase 1 (single-thread) workflow changes
Signed-off-by: Scott Seago <sseago@redhat.com>
2024-09-03 19:04:18 -04:00
Xun Jiang
1d9fbcfcf6 Only get VolumeSnapshotClass when DataUpload exists.
Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2024-08-31 17:53:03 +08:00
Matthieu MOREL
c8baaa9b11 testifylint: enable more rules (#8024)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-07-18 10:43:16 -04:00
Matthieu MOREL
35c90f1672 testifylint: enable error-nil rule (#7670)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-07-16 12:23:16 -04:00
Xun Jiang/Bruce Jiang
920396dfd8 Merge pull request #7969 from blackpiglet/7818_main_fix
[cherry-pick][main]Expose the VolumeHelper to third-party plugins.
2024-07-05 10:14:45 +08:00
Xun Jiang/Bruce Jiang
1ec52beca8 Merge pull request #7410 from seanblong/main
Ignore missing path error in conditional match
2024-07-04 10:10:53 +08:00
Xun Jiang
c4ce6a3382 Expose the VolumeHelper to third-party plugins.
Signed-off-by: Xun Jiang <blackpigletbruce@gmail.com>
2024-07-03 11:16:56 +08:00
Xun Jiang
d89a9f7b0c Check whether the volume's source is PVC before fetching its PV.
Signed-off-by: Xun Jiang <blackpigletbruce@gmail.com>
2024-07-03 10:29:14 +08:00
Xun Jiang
df28134e25 Add result in backup VolumeInfo.
Signed-off-by: Xun Jiang <blackpigletbruce@gmail.com>
2024-07-02 00:20:36 +08:00
Daniel Jiang
5551ded4fd Add checks for csisnapshot for vol_info population
fixes #7874

Signed-off-by: Daniel Jiang <daniel.jiang@broadcom.com>
2024-06-13 11:24:41 +08:00
Daniel Jiang
1d1090083a Use PVC to track the CSI snapshot in restore
This commit fixes #7849.
It will use PVC instead of PV to track CSI snapshots to generate restore
volume info metadata.  So that in the case the PVC is not bound to PV
the metadata can be populated correctly.

Signed-off-by: Daniel Jiang <daniel.jiang@broadcom.com>
2024-06-11 00:30:23 +08:00
Daniel Jiang
bed10c7fe6 Fix the problems found by codespell
Signed-off-by: Daniel Jiang <daniel.jiang@broadcom.com>
2024-05-24 13:32:54 +08:00
Xun Jiang
a91d2cb036 Modify the volume helper logic.
Signed-off-by: Xun Jiang <blackpigletbruce@gmail.com>
2024-05-23 09:57:21 +08:00
Guang Jiong Lou
6c2b66b480 Modify the wrong ConfigMap name in v1.13 node-agent-concurrency document. (#7715)
Fix condition matching in resource modifier when there are multiple rules

Signed-off-by: lou <alex1988@outlook.com>
Co-authored-by: Xun Jiang <blackpigletbruce@gmail.com>
2024-05-14 17:01:50 -04:00
lyndon-li
01a2d952ac Merge pull request #7664 from shubham-pampattiwar/vol-policy-extension-impl
Extend Volume Policies feature to support more actions
2024-04-24 13:39:36 +08:00
Shubham Pampattiwar
8d2bef2486 Extend Volume Policies feature to support more actions
Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>

fix volume policy action execution

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

remove unused files

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

add changelog file

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

fix CI linter errors

fix linter errors

address pr review comments

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

fix via make update cmd

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

address PR feedback and add tests

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

fix codespell

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

fix ci linter checks

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

remove volsToExclude processing from volume policy logic and add tests

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

fix ci linter issue

Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
2024-04-23 12:54:14 -07:00
Xun Jiang
884bcbec98 Fix the typecheck error reported by the lint GitHub action.
Signed-off-by: Xun Jiang <blackpigletbruce@gmail.com>
2024-04-19 18:41:16 +08:00
allenxu404
28552258ae Wait for results of restore exec hook executions in Finalizing phase instead of InProgress phase
Signed-off-by: allenxu404 <qix2@vmware.com>
2024-04-15 17:49:36 +08:00