Skip to content

Commit

Permalink
preflight: Use 'NoFix' for NetworkManager check
Browse files Browse the repository at this point in the history
The "NetworkManager is running" preflight check is not something we want
to automatically fix as it's likely to break the system networking.
It's currently using a dummy 'fix' method which returns an error.
This commit changes this to use the more appropriate 'NoFix' flag.
  • Loading branch information
cfergeau authored and praveenkumar committed Dec 3, 2020
1 parent 4eab359 commit 04e57eb
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions pkg/crc/preflight/preflight_checks_network_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ var nmPreflightChecks = [...]Check{
configKeySuffix: "check-network-manager-installed",
checkDescription: "Checking if NetworkManager is installed",
check: checkNetworkManagerInstalled,
fixDescription: "Checking if NetworkManager is installed",
fix: fixNetworkManagerInstalled,
fixDescription: "NetworkManager is required and must be installed manually",
flags: NoFix,
},
{
configKeySuffix: "check-network-manager-running",
checkDescription: "Checking if NetworkManager service is running",
check: checkNetworkManagerIsRunning,
fixDescription: "Checking if NetworkManager service is running",
fix: fixNetworkManagerIsRunning,
fixDescription: "NetworkManager is required. Please make sure it is installed and running manually",
flags: NoFix,
},
}

Expand Down Expand Up @@ -154,10 +154,6 @@ func checkNetworkManagerInstalled() error {
return nil
}

func fixNetworkManagerInstalled() error {
return fmt.Errorf("NetworkManager is required and must be installed manually")
}

func checkNetworkManagerIsRunning() error {
logging.Debug("Checking if NetworkManager.service is running")
sd := systemd.NewHostSystemdCommander()
Expand All @@ -171,7 +167,3 @@ func checkNetworkManagerIsRunning() error {
logging.Debug("NetworkManager.service is already running")
return nil
}

func fixNetworkManagerIsRunning() error {
return fmt.Errorf("NetworkManager is required. Please make sure it is installed and running manually")
}

0 comments on commit 04e57eb

Please sign in to comment.