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

Data mover backup for Windows nodes #8555

Merged

Conversation

Lyndon-Li
Copy link
Contributor

Fix issue #8418, support data mover backup for Windows nodes

@Lyndon-Li Lyndon-Li force-pushed the data-mover-backup-for-windows-nodes branch from 7a3bde1 to 8a4cf01 Compare December 24, 2024 09:38
@Lyndon-Li Lyndon-Li force-pushed the data-mover-backup-for-windows-nodes branch from 8a4cf01 to 101899e Compare December 24, 2024 09:42
Copy link

codecov bot commented Dec 24, 2024

Codecov Report

Attention: Patch coverage is 64.54545% with 39 lines in your changes missing coverage. Please review.

Project coverage is 59.15%. Comparing base (78c97d9) to head (f5d13ae).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pkg/exposer/csi_snapshot.go 50.00% 13 Missing and 3 partials ⚠️
pkg/cmd/cli/datamover/backup.go 0.00% 12 Missing ⚠️
pkg/nodeagent/node_agent.go 57.14% 4 Missing and 2 partials ⚠️
pkg/controller/data_upload_controller.go 50.00% 2 Missing and 1 partial ⚠️
pkg/util/kube/node.go 85.71% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8555      +/-   ##
==========================================
- Coverage   59.17%   59.15%   -0.02%     
==========================================
  Files         370      370              
  Lines       39487    39568      +81     
==========================================
+ Hits        23366    23408      +42     
- Misses      14647    14680      +33     
- Partials     1474     1480       +6     

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

@Lyndon-Li Lyndon-Li force-pushed the data-mover-backup-for-windows-nodes branch from 101899e to af2d1ce Compare December 26, 2024 02:40
@Lyndon-Li Lyndon-Li marked this pull request as ready for review December 26, 2024 02:41
@Lyndon-Li Lyndon-Li force-pushed the data-mover-backup-for-windows-nodes branch from af2d1ce to f5d13ae Compare December 26, 2024 02:46
@@ -182,7 +182,7 @@ func (r *DataDownloadReconciler) Reconcile(ctx context.Context, req ctrl.Request

hostingPodLabels := map[string]string{velerov1api.DataDownloadLabel: dd.Name}
for _, k := range util.ThirdPartyLabels {
if v, err := nodeagent.GetLabelValue(ctx, r.kubeClient, dd.Namespace, k); err != nil {
if v, err := nodeagent.GetLabelValue(ctx, r.kubeClient, dd.Namespace, k, kube.NodeOSLinux); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

By far, the ThirdPartyLabels only has one value: "azure.workload.identity/use".
First, I'm not sure whether this label is only applied to Linux.
Second, I'm not sure whether Linux-specific is true for the future adding labels.

Copy link
Contributor Author

@Lyndon-Li Lyndon-Li Jan 2, 2025

Choose a reason for hiding this comment

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

This PR is for data mover backup only, we will have another PR for restore.
So we hardcode it to kube.NodeOSLinux for dataDownload for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As for now, we don't want to support linux/Windows differential labels for the ThirdPartyLabels mechanism, we don't see that requirement.
In future, it is required, we come back to see how to support it.

accessMode := exposer.AccessModeFileSystem
if pvc.Spec.VolumeMode != nil && *pvc.Spec.VolumeMode == corev1.PersistentVolumeBlock {
accessMode = exposer.AccessModeBlock
}

hostingPodLabels := map[string]string{velerov1api.DataUploadLabel: du.Name}
for _, k := range util.ThirdPartyLabels {
if v, err := nodeagent.GetLabelValue(context.Background(), r.kubeClient, du.Namespace, k); err != nil {
if v, err := nodeagent.GetLabelValue(context.Background(), r.kubeClient, du.Namespace, k, nodeOS); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Also have the same comments here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Lyndon-Li Lyndon-Li requested a review from blackpiglet January 2, 2025 02:45
@@ -182,7 +182,7 @@ func (r *DataDownloadReconciler) Reconcile(ctx context.Context, req ctrl.Request

hostingPodLabels := map[string]string{velerov1api.DataDownloadLabel: dd.Name}
for _, k := range util.ThirdPartyLabels {
if v, err := nodeagent.GetLabelValue(ctx, r.kubeClient, dd.Namespace, k); err != nil {
if v, err := nodeagent.GetLabelValue(ctx, r.kubeClient, dd.Namespace, k, kube.NodeOSLinux); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the OS is hardcoded as Linux here while reading OS from the PVC attaching node in data upload controller?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -354,7 +354,7 @@ func (e *genericRestoreExposer) createRestorePod(ctx context.Context, ownerObjec
containerName := string(ownerObject.UID)
volumeName := string(ownerObject.UID)

podInfo, err := getInheritedPodInfo(ctx, e.kubeClient, ownerObject.Namespace)
podInfo, err := getInheritedPodInfo(ctx, e.kubeClient, ownerObject.Namespace, kube.NodeOSLinux)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment here.

@Lyndon-Li Lyndon-Li requested a review from ywk253100 January 2, 2025 02:52
@ywk253100 ywk253100 merged commit 03d0bd9 into vmware-tanzu:main Jan 2, 2025
41 of 42 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