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

fs-backup for clusters with windows nodes #8518

Merged

Conversation

Lyndon-Li
Copy link
Contributor

@Lyndon-Li Lyndon-Li commented Dec 17, 2024

Make fs-backup work on linux nodes with the new Velero deployment and disable fs-backup if the source/target pod is running in non-linux node (#8424)

@Lyndon-Li Lyndon-Li force-pushed the fail-fs-backup-on-windows-nodes branch from 54dbb7f to 96cd224 Compare December 17, 2024 06:21
@Lyndon-Li Lyndon-Li force-pushed the fail-fs-backup-on-windows-nodes branch 5 times, most recently from 2e3e3f0 to 33efb69 Compare December 18, 2024 02:18
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 47.05882% with 36 lines in your changes missing coverage. Please review.

Project coverage is 59.17%. Comparing base (ea93c00) to head (4e0a0e0).
Report is 24 commits behind head on main.

Files with missing lines Patch % Lines
pkg/util/kube/node.go 63.15% 11 Missing and 3 partials ⚠️
pkg/cmd/server/server.go 0.00% 12 Missing ⚠️
pkg/podvolume/backupper.go 0.00% 4 Missing and 1 partial ⚠️
pkg/nodeagent/node_agent.go 33.33% 4 Missing ⚠️
pkg/cmd/cli/install/install.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8518   +/-   ##
=======================================
  Coverage   59.16%   59.17%           
=======================================
  Files         369      370    +1     
  Lines       39413    39487   +74     
=======================================
+ Hits        23319    23366   +47     
- Misses      14624    14647   +23     
- Partials     1470     1474    +4     

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

@Lyndon-Li Lyndon-Li force-pushed the fail-fs-backup-on-windows-nodes branch from 33efb69 to a711b10 Compare December 18, 2024 02:46
@Lyndon-Li Lyndon-Li changed the title Fail fs-backup for windows nodes fs-backup for windows nodes Dec 18, 2024
@Lyndon-Li Lyndon-Li marked this pull request as ready for review December 20, 2024 09:00
pkg/util/kube/node.go Outdated Show resolved Hide resolved
pkg/util/kube/node.go Outdated Show resolved Hide resolved
pkg/util/kube/node.go Outdated Show resolved Hide resolved
}
}

if kube.WithWindowsNode(s.ctx, s.crClient, s.logger) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to check this if the Windows node agent isn't enabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't need to do this.
This is a sanity check and needs to state the fact in all cases when Windows/linux nodes exist but fs-backup/data mover won't work in the nodes.

@Lyndon-Li Lyndon-Li requested a review from ywk253100 December 24, 2024 06:28
}
}

if !allNodeLabeled {
Copy link
Contributor

Choose a reason for hiding this comment

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

The variable allNodeLabeled is useless.
If the expected OS is found, the code returns directly inside the for loop.
We can log the warning message directly just before the last return false.

This is tiny, feel free to change it or not.
Approved.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When return false is reached, there are two possibilities: 1. all nodes are with OS label, but are not with the expected OS type value; 2. not all nodes with OS label. So it's better to use allNodeLabeled to track these two cases.

Copy link
Member

@kaovilai kaovilai left a comment

Choose a reason for hiding this comment

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

I would retitle PR to disabling fs-backup for Non-Linux Nodes.

@Lyndon-Li Lyndon-Li changed the title fs-backup for windows nodes fs-backup for clusters with windows nodes Dec 24, 2024
@Lyndon-Li
Copy link
Contributor Author

I would retitle PR to disabling fs-backup for Non-Linux Nodes.

Changed it to fs-backup for clusters with windows nodes, as you can see there are two purpose for this PR.

Copy link
Member

@kaovilai kaovilai left a comment

Choose a reason for hiding this comment

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

title lgtm

@Lyndon-Li Lyndon-Li merged commit 78c97d9 into vmware-tanzu:main Dec 24, 2024
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