kubeadm: wrap error properly in check_windows.go

This commit is contained in:
Sha Liu 2020-03-09 22:29:15 +11:00
parent 672aa55ee4
commit 12750ac64f

View File

@ -32,12 +32,12 @@ const administratorSID = "S-1-5-32-544"
func (ipuc IsPrivilegedUserCheck) Check() (warnings, errorList []error) { func (ipuc IsPrivilegedUserCheck) Check() (warnings, errorList []error) {
currUser, err := user.Current() currUser, err := user.Current()
if err != nil { if err != nil {
return nil, []error{errors.New("cannot get current user")} return nil, []error{errors.Wrap(err, "cannot get current user")}
} }
groupIds, err := currUser.GroupIds() groupIds, err := currUser.GroupIds()
if err != nil { if err != nil {
return nil, []error{errors.New("cannot get group IDs for current user")} return nil, []error{errors.Wrap(err, "cannot get group IDs for current user")}
} }
for _, sid := range groupIds { for _, sid := range groupIds {