Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add annotation "pv.kubernetes.io/migrated-to" for CSI checking. #5181

Merged

Conversation

blackpiglet
Copy link
Contributor

@blackpiglet blackpiglet commented Aug 4, 2022

  1. Also checking annotation "pv.kubernetes.io/migrated-to" to find out whether volume is provisioned by CSI.
  2. Add UT test cases.

Signed-off-by: Xun Jiang [email protected]

Thank you for contributing to Velero!

Please add a summary of your change

Does your change fix a particular issue?

Fixes #5149

Please indicate you've done the following:

  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Created a changelog file or added /kind changelog-not-required as a comment on this pull request.
  • Updated the corresponding documentation in site/content/docs/main.

@blackpiglet blackpiglet self-assigned this Aug 4, 2022
@github-actions github-actions bot added Dependencies Pull requests that update a dependency file has-unit-tests labels Aug 4, 2022
@github-actions github-actions bot requested review from dsu-igeek and ywk253100 August 4, 2022 14:50
@blackpiglet blackpiglet requested review from reasonerjt and removed request for dsu-igeek August 4, 2022 14:51
@blackpiglet blackpiglet force-pushed the restic-volume-path-change branch from 04db3c9 to 6e94626 Compare August 4, 2022 14:53
@blackpiglet blackpiglet force-pushed the restic-volume-path-change branch 3 times, most recently from b597978 to 6079636 Compare August 4, 2022 16:21
@codecov-commenter
Copy link

codecov-commenter commented Aug 4, 2022

Codecov Report

Merging #5181 (7af1e23) into main (701256d) will increase coverage by 0.35%.
The diff coverage is 58.82%.

@@            Coverage Diff             @@
##             main    #5181      +/-   ##
==========================================
+ Coverage   41.25%   41.61%   +0.35%     
==========================================
  Files         212      215       +3     
  Lines       18663    18620      -43     
==========================================
+ Hits         7700     7749      +49     
+ Misses      10389    10294      -95     
- Partials      574      577       +3     
Impacted Files Coverage Δ
pkg/controller/pod_volume_restore_controller.go 22.85% <0.00%> (+0.73%) ⬆️
pkg/util/kube/utils.go 73.79% <64.28%> (-1.59%) ⬇️
pkg/controller/pod_volume_backup_controller.go 44.06% <100.00%> (+0.39%) ⬆️
pkg/restic/common.go 30.00% <0.00%> (-35.86%) ⬇️
pkg/builder/container_builder.go 33.78% <0.00%> (-4.10%) ⬇️
internal/hook/item_hook_handler.go 87.92% <0.00%> (-1.48%) ⬇️
pkg/controller/restore_controller.go 65.07% <0.00%> (-1.44%) ⬇️
pkg/cmd/server/server.go 6.50% <0.00%> (ø)
pkg/repository/config/config.go 95.91% <0.00%> (ø)
... and 16 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@blackpiglet blackpiglet force-pushed the restic-volume-path-change branch 2 times, most recently from 11e3d89 to bad893b Compare August 5, 2022 01:24
pkg/util/kube/utils.go Show resolved Hide resolved
pkg/util/kube/utils.go Outdated Show resolved Hide resolved
@blackpiglet blackpiglet force-pushed the restic-volume-path-change branch 4 times, most recently from ba868db to 7bd9b4e Compare August 5, 2022 22:55
@github-actions github-actions bot removed the Dependencies Pull requests that update a dependency file label Aug 5, 2022
@blackpiglet blackpiglet force-pushed the restic-volume-path-change branch from 7bd9b4e to 43f1ab8 Compare August 5, 2022 23:33
@blackpiglet
Copy link
Contributor Author

Verified with following test cases:

  1. backup and restore in same cluster with CSI migration enabled. Pod mounted with in-tree volume.
  2. backup and restore in same cluster with CSI migration enabled. Pod mounted with in-tree volume and emptyDir volume.
  3. backup and restore in different cluster. backup cluster enabled CSI migration. restore cluster didn't enable CSI migration. Pod mounted with in-tree volume.
  4. backup and restore in different cluster. backup cluster didn't enable CSI migration. restore cluster enabled CSI migration. Pod mounted with in-tree volume.

@blackpiglet blackpiglet force-pushed the restic-volume-path-change branch 2 times, most recently from 8dfe259 to 3d5d802 Compare August 6, 2022 13:08
pkg/util/kube/utils.go Outdated Show resolved Hide resolved
pkg/util/kube/utils.go Outdated Show resolved Hide resolved
1. Also checking annotation "pv.kubernetes.io/migrated-to" to find out whether volume is provisioned by CSI.
2. Add UT cases.

Signed-off-by: Xun Jiang <[email protected]>
@blackpiglet blackpiglet force-pushed the restic-volume-path-change branch from 3d5d802 to 7af1e23 Compare August 8, 2022 02:59
@reasonerjt reasonerjt merged commit ba50458 into vmware-tanzu:main Aug 8, 2022
@blackpiglet blackpiglet deleted the restic-volume-path-change branch October 15, 2022 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants