don't skip unit tests in preflight/checks_test.go when not running as root #3124
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
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
The text was updated successfully, but these errors were encountered: