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

Issue 7036: node selection for data mover backup #7437

Merged
merged 3 commits into from
Mar 29, 2024

Conversation

Lyndon-Li
Copy link
Contributor

@Lyndon-Li Lyndon-Li commented Feb 18, 2024

Fix issue #7036. Add the implementation of node selection for data mover backups

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

codecov bot commented Feb 18, 2024

Codecov Report

Attention: Patch coverage is 84.68468% with 17 lines in your changes are missing coverage. Please review.

Project coverage is 61.74%. Comparing base (1034d6a) to head (dccde10).
Report is 64 commits behind head on main.

Files Patch % Lines
pkg/cmd/cli/nodeagent/server.go 58.82% 7 Missing ⚠️
pkg/exposer/csi_snapshot.go 92.85% 3 Missing and 1 partial ⚠️
pkg/exposer/generic_restore.go 78.94% 3 Missing and 1 partial ⚠️
pkg/controller/data_download_controller.go 80.00% 0 Missing and 1 partial ⚠️
pkg/controller/data_upload_controller.go 87.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7437      +/-   ##
==========================================
+ Coverage   61.73%   61.74%   +0.01%     
==========================================
  Files         262      263       +1     
  Lines       28429    28780     +351     
==========================================
+ Hits        17550    17770     +220     
- Misses       9646     9763     +117     
- Partials     1233     1247      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
@@ -455,3 +485,42 @@ func (e *csiSnapshotExposer) createBackupPod(ctx context.Context, ownerObject co

return e.kubeClient.CoreV1().Pods(ownerObject.Namespace).Create(ctx, pod, metav1.CreateOptions{})
}

func toSystemAffinity(loadAffinity *nodeagent.LoadAffinity) *corev1.Affinity {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why we cannot use the corev1.Affinity directly rather than defining our own type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think there are two questions:

  • Why do we wrap metav1.LabelSelector/corev1.Affinity instead of using it directly? -- We may need to add some other controllers that metav1.LabelSelector/corev1.Affinity cannot provide in future, so we add a simple wrap here. Whenever we want to change, we just append new fields so as to avoid break changes.
  • Why don't we use corev1.Affinity directly? -- corev1.Affinity is more complex than we want to provide to users, e.g., we only use RequiredDuringSchedulingIgnoredDuringExecution, so we need to limit users input

Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
@Lyndon-Li Lyndon-Li merged commit 67bd694 into vmware-tanzu:main Mar 29, 2024
66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants