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

don't skip unit tests in preflight/checks_test.go when not running as root #3124

Closed
neolit123 opened this issue Nov 13, 2024 · 1 comment · Fixed by kubernetes/kubernetes#128799
Assignees
Labels
area/test kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. priority/backlog Higher priority than priority/awaiting-more-evidence.
Milestone

Comments

@neolit123
Copy link
Member

in these two instances:
https://github.com/kubernetes/kubernetes/tree/v1.31.0/cmd/kubeadm/app/preflight/checks_test.go#L905-L909
https://github.com/kubernetes/kubernetes/tree/v1.31.0/cmd/kubeadm/app/preflight/checks_test.go#L972-L976

we skip UT because the functions JoinNodeChecks and InitNodeChecks call RunRootCheckOnly which is the check for root.
the functions should instead not call any checks and only return the list of checks.
the first check added to the list should be IsPrivilegedUserCheck{} and we can try to remove this "fail fast" idea.

if that doesn't work we can call explicitly RunRootCheckOnly before all locations where JoinNodeChecks and InitNodeChecks are called.

RunRootCheckOnly should be kept because it's called in various other places:
https://github.com/search?q=repo%3Akubernetes%2Fkubernetes%20RunRootCheckOnly&type=code

@neolit123 neolit123 added priority/backlog Higher priority than priority/awaiting-more-evidence. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. area/test labels Nov 13, 2024
@neolit123 neolit123 added this to the v1.32 milestone Nov 13, 2024
@srivastav-abhishek
Copy link

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/test kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants