Skip to content

Commit

Permalink
Issue #743 Make user checks skippable
Browse files Browse the repository at this point in the history
  • Loading branch information
gbraad authored and praveenkumar committed Oct 19, 2019
1 parent e2277cc commit 26f7b7d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions cmd/crc/cmd/config/config_darwin.go
Expand Up @@ -6,6 +6,8 @@ import (

var (
// Preflight checks
SkipCheckRootUser = cfg.AddSetting("skip-check-root-user", nil, []cfg.ValidationFnType{cfg.ValidateBool}, []cfg.SetFn{cfg.SuccessfullyApplied})
WarnCheckRootUser = cfg.AddSetting("warn-check-root-user", nil, []cfg.ValidationFnType{cfg.ValidateBool}, []cfg.SetFn{cfg.SuccessfullyApplied})
SkipCheckVirtualBoxInstalled = cfg.AddSetting("skip-check-virtualbox-installed", nil, []cfg.ValidationFnType{cfg.ValidateBool}, []cfg.SetFn{cfg.SuccessfullyApplied})
WarnCheckVirtualBoxInstalled = cfg.AddSetting("warn-check-virtualbox-installed", nil, []cfg.ValidationFnType{cfg.ValidateBool}, []cfg.SetFn{cfg.SuccessfullyApplied})
SkipCheckResolverFilePermissions = cfg.AddSetting("skip-check-resolver-file-permissions", nil, []cfg.ValidationFnType{cfg.ValidateBool}, []cfg.SetFn{cfg.SuccessfullyApplied})
Expand Down
2 changes: 2 additions & 0 deletions cmd/crc/cmd/config/config_linux.go
Expand Up @@ -6,6 +6,8 @@ import (

var (
// Preflight checks
SkipCheckRootUser = cfg.AddSetting("skip-check-root-user", nil, []cfg.ValidationFnType{cfg.ValidateBool}, []cfg.SetFn{cfg.SuccessfullyApplied})
WarnCheckRootUser = cfg.AddSetting("warn-check-root-user", nil, []cfg.ValidationFnType{cfg.ValidateBool}, []cfg.SetFn{cfg.SuccessfullyApplied})
SkipCheckVirtEnabled = cfg.AddSetting("skip-check-virt-enabled", nil, []cfg.ValidationFnType{cfg.ValidateBool}, []cfg.SetFn{cfg.SuccessfullyApplied})
WarnCheckVirtEnabled = cfg.AddSetting("warn-check-virt-enabled", nil, []cfg.ValidationFnType{cfg.ValidateBool}, []cfg.SetFn{cfg.SuccessfullyApplied})
SkipCheckKvmEnabled = cfg.AddSetting("skip-check-kvm-enabled", nil, []cfg.ValidationFnType{cfg.ValidateBool}, []cfg.SetFn{cfg.SuccessfullyApplied})
Expand Down
2 changes: 2 additions & 0 deletions cmd/crc/cmd/config/config_windows.go
Expand Up @@ -6,6 +6,8 @@ import (

var (
// Preflight checks
SkipCheckAdministratorUser = cfg.AddSetting("skip-check-administrator-user", nil, []cfg.ValidationFnType{cfg.ValidateBool}, []cfg.SetFn{cfg.SuccessfullyApplied})
WarnCheckAdministratorUser = cfg.AddSetting("warn-check-administrator-user", nil, []cfg.ValidationFnType{cfg.ValidateBool}, []cfg.SetFn{cfg.SuccessfullyApplied})
SkipCheckWindowsVersionCheck = cfg.AddSetting("skip-check-windows-version", nil, []cfg.ValidationFnType{cfg.ValidateBool}, []cfg.SetFn{cfg.SuccessfullyApplied})
WarnCheckWindowsVersionCheck = cfg.AddSetting("warn-check-windows-version", nil, []cfg.ValidationFnType{cfg.ValidateBool}, []cfg.SetFn{cfg.SuccessfullyApplied})
SkipCheckHyperVInstalled = cfg.AddSetting("skip-check-hyperv-installed", nil, []cfg.ValidationFnType{cfg.ValidateBool}, []cfg.SetFn{cfg.SuccessfullyApplied})
Expand Down
4 changes: 2 additions & 2 deletions pkg/crc/preflight/preflight_darwin.go
Expand Up @@ -8,10 +8,10 @@ import (

// StartPreflightChecks performs the preflight checks before starting the cluster
func StartPreflightChecks(vmDriver string) {
preflightCheckSucceedsOrFails(false,
preflightCheckSucceedsOrFails(config.GetBool(cmdConfig.SkipCheckRootUser.Name),
checkIfRunningAsNormalUser,
"Checking if running as non-root",
false,
config.GetBool(cmdConfig.WarnCheckRootUser.Name),
)
preflightCheckSucceedsOrFails(false,
checkOcBinaryCached,
Expand Down
4 changes: 2 additions & 2 deletions pkg/crc/preflight/preflight_linux.go
Expand Up @@ -7,10 +7,10 @@ import (

// StartPreflightChecks performs the preflight checks before starting the cluster
func StartPreflightChecks(vmDriver string) {
preflightCheckSucceedsOrFails(false,
preflightCheckSucceedsOrFails(config.GetBool(cmdConfig.SkipCheckRootUser.Name),
checkIfRunningAsNormalUser,
"Checking if running as non-root",
false,
config.GetBool(cmdConfig.WarnCheckRootUser.Name),
)
preflightCheckSucceedsOrFails(false,
checkOcBinaryCached,
Expand Down
4 changes: 2 additions & 2 deletions pkg/crc/preflight/preflight_windows.go
Expand Up @@ -7,10 +7,10 @@ import (

// StartPreflightChecks performs the preflight checks before starting the cluster
func StartPreflightChecks(vmDriver string) {
preflightCheckSucceedsOrFails(false,
preflightCheckSucceedsOrFails(config.GetBool(cmdConfig.SkipCheckAdministratorUser.Name),
checkIfRunningAsNormalUserInWindows,
"Checking if running as normal user",
false,
config.GetBool(cmdConfig.WarnCheckAdministratorUser.Name),
)
preflightCheckSucceedsOrFails(config.GetBool(cmdConfig.SkipCheckWindowsVersionCheck.Name),
checkOcBinaryCached,
Expand Down

0 comments on commit 26f7b7d

Please sign in to comment.