Skip to content

Commit

Permalink
Decouple admin-helper and hyperv group checks and remove admin-helper…
Browse files Browse the repository at this point in the history
… group check

Since `crc setup` is only going to be ran from the installer and the msi
already takes care of creating the crc-users group and adding current user
to it, we only need to perform the addition to Hyper-V admins group which
the msi is not able to do due to localized name of the group
  • Loading branch information
anjannath authored and praveenkumar committed Aug 12, 2021
1 parent e1f3051 commit dae1e45
Showing 1 changed file with 5 additions and 24 deletions.
29 changes: 5 additions & 24 deletions pkg/crc/preflight/preflight_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,30 +82,11 @@ var hypervPreflightChecks = []Check{
},
{
configKeySuffix: "check-user-in-hyperv-group",
checkDescription: "Checking if current user is in Hyper-V group and crc-users group",
check: func() error {
if err := adminHelperGroup.check(); err != nil {
return err
}
return hypervGroup.check()
},
fixDescription: "Adding current user to group",
fix: func() error {
m := crcerrors.MultiError{}
if err := adminHelperGroup.check(); err != nil {
m.Collect(adminHelperGroup.fix())
}
if err := hypervGroup.check(); err != nil {
m.Collect(hypervGroup.fix())
}
if len(m.Errors) == 0 {
return nil
}
if m.Errors[0] == errReboot {
return errReboot
}
return m
},
checkDescription: "Checking if current user is in Hyper-V Admins group",
check: checkIfUserPartOfHyperVAdmins,
fixDescription: "Adding current user to Hyper-V Admins group",
fix: fixUserPartOfHyperVAdmins,

labels: labels{Os: Windows},
},
{
Expand Down

0 comments on commit dae1e45

Please sign in to comment.