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

Migrate backup sync controller from code-generator to kubebuilder #4423

Merged

Conversation

blackpiglet
Copy link
Contributor

  1. use kubebuilder's reconcile logic to replace controller's old logic.
  2. use ginkgo and gomega to replace testing.

Signed-off-by: Xun Jiang jxun@vmware.com

Thank you for contributing to Velero!

Please add a summary of your change

Does your change fix a particular issue?

Fixes #(issue)

Please indicate you've done the following:

@blackpiglet blackpiglet added this to the v1.8.0 milestone Dec 2, 2021
@blackpiglet blackpiglet self-assigned this Dec 2, 2021
@blackpiglet blackpiglet added this to In progress in Velero v1.8 Sprint 7 (12-Jan-2022) via automation Dec 2, 2021
@blackpiglet blackpiglet force-pushed the 4135-convert-backup-sync-to-kubebuilder branch 2 times, most recently from 0253587 to 55f9920 Compare December 2, 2021 14:53
1. use kubebuilder's reconcile logic to replace controller's old logic.
2. use ginkgo and gomega to replace testing.

Signed-off-by: Xun Jiang <jxun@vmware.com>
@blackpiglet blackpiglet force-pushed the 4135-convert-backup-sync-to-kubebuilder branch from 441cb89 to 3893a25 Compare December 3, 2021 03:18
pkg/cmd/server/server.go Outdated Show resolved Hide resolved
pkg/controller/backup_sync_controller.go Outdated Show resolved Hide resolved
pkg/controller/backup_sync_controller.go Show resolved Hide resolved
pkg/controller/backup_sync_controller.go Show resolved Hide resolved
pkg/controller/backup_sync_controller_test.go Outdated Show resolved Hide resolved
pkg/controller/backup_sync_controller_test.go Outdated Show resolved Hide resolved
pkg/controller/backup_sync_controller.go Outdated Show resolved Hide resolved
@blackpiglet blackpiglet force-pushed the 4135-convert-backup-sync-to-kubebuilder branch 2 times, most recently from f390a1d to 8a8d5c0 Compare December 7, 2021 08:44
1. Remove DefaultBackupLocation
2. Remove unneccessary comment line
3. Add syncPeriod default value setting logic
4. Modify ListBackupStorageLocations function's context parameter
5. Add RequeueAfter parameter in Reconcile function return value

Signed-off-by: Xun Jiang <jxun@vmware.com>
@blackpiglet blackpiglet force-pushed the 4135-convert-backup-sync-to-kubebuilder branch from 8a8d5c0 to 61578d6 Compare December 7, 2021 09:32
zubron
zubron previously approved these changes Dec 9, 2021
Copy link
Contributor

@zubron zubron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks!

1. Use context passed from parameter, instead of using Reconciler struct's context.
2. Delete Reconciler struct's context member.
3. Modify test case accordingly.

Signed-off-by: Xun Jiang <jxun@vmware.com>
@zubron zubron merged commit 5aaeb3e into vmware-tanzu:main Dec 15, 2021
Velero v1.8 Sprint 7 (12-Jan-2022) automation moved this from In progress to Done Dec 15, 2021
blackpiglet pushed a commit to blackpiglet/velero that referenced this pull request Dec 17, 2021
danfengliu pushed a commit to danfengliu/velero that referenced this pull request Jan 25, 2022
…ware-tanzu#4423)

* Migrate backup sync controller from code-generator to kubebuilder

1. use kubebuilder's reconcile logic to replace controller's old logic.
2. use ginkgo and gomega to replace testing.

Signed-off-by: Xun Jiang <jxun@vmware.com>

* Fix: modify code according to comments

1. Remove DefaultBackupLocation
2. Remove unneccessary comment line
3. Add syncPeriod default value setting logic
4. Modify ListBackupStorageLocations function's context parameter
5. Add RequeueAfter parameter in Reconcile function return value

Signed-off-by: Xun Jiang <jxun@vmware.com>

* Reconcile function use context passed from parameter

1. Use context passed from parameter, instead of using Reconciler struct's context.
2. Delete Reconciler struct's context member.
3. Modify test case accordingly.

Signed-off-by: Xun Jiang <jxun@vmware.com>
danfengliu pushed a commit to danfengliu/velero that referenced this pull request Jan 25, 2022
gyaozhou pushed a commit to gyaozhou/velero-read that referenced this pull request May 14, 2022
…ware-tanzu#4423)

* Migrate backup sync controller from code-generator to kubebuilder

1. use kubebuilder's reconcile logic to replace controller's old logic.
2. use ginkgo and gomega to replace testing.

Signed-off-by: Xun Jiang <jxun@vmware.com>

* Fix: modify code according to comments

1. Remove DefaultBackupLocation
2. Remove unneccessary comment line
3. Add syncPeriod default value setting logic
4. Modify ListBackupStorageLocations function's context parameter
5. Add RequeueAfter parameter in Reconcile function return value

Signed-off-by: Xun Jiang <jxun@vmware.com>

* Reconcile function use context passed from parameter

1. Use context passed from parameter, instead of using Reconciler struct's context.
2. Delete Reconciler struct's context member.
3. Modify test case accordingly.

Signed-off-by: Xun Jiang <jxun@vmware.com>
gyaozhou pushed a commit to gyaozhou/velero-read that referenced this pull request May 14, 2022
@blackpiglet blackpiglet deleted the 4135-convert-backup-sync-to-kubebuilder branch October 15, 2022 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants