-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
kubeadm: update the IsPriviligedUser preflight check on Windows #124665
kubeadm: update the IsPriviligedUser preflight check on Windows #124665
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: neolit123 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/triage accepted /cc @jsturtevant @marosset |
/kind bug |
but i don't see related errors to the preflight check IsPriviligedUser or this PR |
/retest |
if err != nil { | ||
return nil, []error{errors.Wrap(err, "cannot get group IDs for current user")} | ||
var hProcessToken windows.Token | ||
if err := windows.OpenProcessToken(windows.CurrentProcess(), windows.TOKEN_QUERY, &hProcessToken); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be good idea to call token.close
on this token or use https://pkg.go.dev/golang.org/x/sys/windows#GetCurrentProcessToken which states it doesn't need to be closed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great, i didn't notice that function earlier.
updated.
Test passed the second time, I also saw that the Nodes came online the first time which means kubeadm worked. |
Use GetCurrentProcessToken() instead of checking the groups of a user. The Go stdlib way of fetching the groups of an user appears to be failing on some Windows setups. Which could be a regression in later Go versions, or simply the code does not work on certain setups.
66f157b
to
d105ddd
Compare
/lgtm |
LGTM label has been added. Git tree hash: 167d5d8028c8ccd4123f83e9f34b3fdebe6fa99d
|
/hold cancel |
What type of PR is this?
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes kubernetes/kubeadm#3053
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: