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

Add debug logs for windows preflight checks and setup #761

Merged
merged 2 commits into from Nov 1, 2019

Conversation

anjannath
Copy link
Member

Also as suggested added a fall-back location for Powershell, in case it is not it path.
Fixes #753

yourWindowsReleaseId, err := strconv.Atoi(strings.TrimSpace(stdOut))

if err != nil {
logging.Debug(err.Error())
return false, errors.New("Failed to get Windows release id")
Copy link
Contributor

Choose a reason for hiding this comment

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

This is exactly the same error returned in this case and before, which could make it harder to figure out which of the 2 functions failed. This one could be changed to "Failed to parse Windows release id: %s", stdOut

pkg/crc/preflight/preflight_checks_windows.go Show resolved Hide resolved
@cfergeau
Copy link
Contributor

make cross-lint fails with

pkg/crc/preflight/preflight_checks_windows.go:34:66: too many arguments (typecheck)

		return false, errors.New("Failed to parse Windows release id", stdOut)

Copy link
Contributor

@cfergeau cfergeau left a comment

Choose a reason for hiding this comment

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

Looks good to me, was this tested on a fresh windows install?

stdOut, _, err := powershell.Execute(checkIfMemberOfHyperVAdmins)
if err != nil {
logging.Debug(err.Error())
return false, errors.New("Failed checking if user is part of hyperv admins group")
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you check preflight on Windows after these changes? I wonder if we get an error when user is not a member of the admin group, or just regular output from the command?

@gbraad
Copy link
Contributor

gbraad commented Oct 31, 2019

You did see #777?

… in PATH

if exec.LookPath can't find the location of powershell.exe
we fall back to using C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Also add more debug logs to windows preflight checks and setup
@praveenkumar
Copy link
Member

retest this please

@praveenkumar praveenkumar merged commit 4347c0e into crc-org:master Nov 1, 2019
@gbraad
Copy link
Contributor

gbraad commented Nov 1, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add more debug logging to windows preflight checks and setup
4 participants