Repository: code-ready/crc
Pull request #1658 (2020-11-10 14:56:33)

Remove hyperkit machines directory during crc cleanup
Fixes: #1346 

The second commit does the removing of hyperkit directory.

openshift-ci-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/code-ready/crc/pull/1658#" title="Author self-approved">anjannath</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=code-ready%2Fcrc).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/code-ready/crc/blob/master/OWNERS)~~ [anjannath]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->
openshift-merge-robot: @anjannath: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
ci/prow/e2e-crc | f4e8da1478782966846f2d1023dae25a76bd8914 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/1658/pull-ci-code-ready-crc-master-e2e-crc/1326176935839010816) | `/test e2e-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=1658). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:anjannath).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-merge-robot: @anjannath: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
ci/prow/e2e-crc | c7c6ad9080d449536b363619230e995f587a687e | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/1658/pull-ci-code-ready-crc-master-e2e-crc/1326261346756464640) | `/test e2e-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=1658). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:anjannath).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-merge-robot: @anjannath: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
ci/prow/e2e-crc | f4e8da1478782966846f2d1023dae25a76bd8914 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/1658/pull-ci-code-ready-crc-master-e2e-crc/1326847086305480704) | `/test e2e-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=1658). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:anjannath).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-merge-robot: @anjannath: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
ci/prow/e2e-crc | 60cbb910bba1ba826954be654a0b324c830df6b5 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/1658/pull-ci-code-ready-crc-master-e2e-crc/1328272290902708224) | `/test e2e-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=1658). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:anjannath).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-merge-robot: @anjannath: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
ci/prow/e2e-crc | 865f0b19b1757945f19b57393736883b6c475df9 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/1658/pull-ci-code-ready-crc-master-e2e-crc/1328600297571880960) | `/test e2e-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=1658). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:anjannath).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-ci-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/code-ready/crc/pull/1658#" title="Author self-approved">anjannath</a>*, *<a href="https://github.com/code-ready/crc/pull/1658#pullrequestreview-532587267" title="Approved">cfergeau</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=code-ready%2Fcrc).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/code-ready/crc/blob/master/OWNERS)~~ [anjannath,cfergeau]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->
openshift-ci-robot: New changes are detected. LGTM label has been removed.
openshift-merge-robot: @anjannath: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
ci/prow/e2e-crc | 865f0b19b1757945f19b57393736883b6c475df9 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/1658/pull-ci-code-ready-crc-master-e2e-crc/1328600297571880960) | `/test e2e-crc`
ci/prow/images | 3979b8f1a4b20a1a846c135bb4de9573e25c6900 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/1658/pull-ci-code-ready-crc-master-images/1328961254605197312) | `/test images`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=1658). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:anjannath).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-merge-robot: @anjannath: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
ci/prow/images | 3979b8f1a4b20a1a846c135bb4de9573e25c6900 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/1658/pull-ci-code-ready-crc-master-images/1328961254605197312) | `/test images`
ci/prow/e2e-crc | 3979b8f1a4b20a1a846c135bb4de9573e25c6900 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/1658/pull-ci-code-ready-crc-master-e2e-crc/1328961254571642880) | `/test e2e-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=1658). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:anjannath).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-merge-robot: @anjannath: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
ci/prow/e2e-crc | d62154ce9b48ceb73f7493ba80689b456dfafd1f | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/1658/pull-ci-code-ready-crc-master-e2e-crc/1329680589757878272) | `/test e2e-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=1658). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:anjannath).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-merge-robot: @anjannath: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
ci/prow/e2e-crc | 1d9dd19676253bf525c4d14abbc2b96d16d1ea4f | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/1658/pull-ci-code-ready-crc-master-e2e-crc/1331847982701613056) | `/test e2e-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=1658). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:anjannath).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-merge-robot: @anjannath: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
ci/prow/e2e-crc | 9579eddc6bd5f27a142ca4d50718ff80ea294126 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/1658/pull-ci-code-ready-crc-master-e2e-crc/1331904790556315648) | `/test e2e-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=1658). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:anjannath).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-ci-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/code-ready/crc/pull/1658#" title="Author self-approved">anjannath</a>*, *<a href="https://github.com/code-ready/crc/pull/1658#pullrequestreview-539291746" title="Approved">cfergeau</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=code-ready%2Fcrc).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/code-ready/crc/blob/master/OWNERS)~~ [anjannath,cfergeau]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->

Patch:
diff --git a/pkg/crc/preflight/preflight.go b/pkg/crc/preflight/preflight.go
index c02bc3def..7652758ab 100644
--- a/pkg/crc/preflight/preflight.go
+++ b/pkg/crc/preflight/preflight.go
@@ -5,6 +5,7 @@ import (
 
 	cmdConfig "github.com/code-ready/crc/cmd/crc/cmd/config"
 	"github.com/code-ready/crc/pkg/crc/config"
+	"github.com/code-ready/crc/pkg/crc/errors"
 	"github.com/code-ready/crc/pkg/crc/logging"
 	"github.com/code-ready/crc/pkg/crc/network"
 )
@@ -143,6 +144,7 @@ func doFixPreflightChecks(config config.Storage, checks []Check) error {
 }
 
 func doCleanUpPreflightChecks(checks []Check) error {
+	var mErr errors.MultiError
 	// Do the cleanup in reverse order to avoid any dependency during cleanup
 	for i := len(checks) - 1; i >= 0; i-- {
 		check := checks[i]
@@ -151,10 +153,16 @@ func doCleanUpPreflightChecks(checks []Check) error {
 		}
 		err := check.doCleanUp()
 		if err != nil {
-			return err
+			// If an error occurs in a cleanup function
+			// we log/collect it and  move to the  next
+			logging.Debug(err)
+			mErr.Collect(err)
 		}
 	}
-	return nil
+	if len(mErr.Errors) == 0 {
+		return nil
+	}
+	return mErr
 }
 
 func doRegisterSettings(cfg config.Schema, checks []Check) {
diff --git a/pkg/crc/preflight/preflight_checks_common.go b/pkg/crc/preflight/preflight_checks_common.go
index 3a21230be..5a85313ab 100644
--- a/pkg/crc/preflight/preflight_checks_common.go
+++ b/pkg/crc/preflight/preflight_checks_common.go
@@ -47,6 +47,11 @@ var genericPreflightChecks = [...]Check{
 		fixDescription: fmt.Sprintf("crc requires at least %s to run", units.HumanSize(float64(constants.DefaultMemory*1024*1024))),
 		flags:          NoFix,
 	},
+	{
+		cleanupDescription: "Removing CRC Machine Instance directory",
+		cleanup:            removeCRCMachinesDir,
+		flags:              CleanUpOnly,
+	},
 }
 
 func checkBundleExtracted() error {
@@ -115,3 +120,11 @@ func fixGoodhostsExecutableCached() error {
 	logging.Debug("goodhost executable cached")
 	return setSuid(goodhost.GetExecutablePath())
 }
+
+func removeCRCMachinesDir() error {
+	logging.Debug("Deleting machines directory")
+	if err := os.RemoveAll(constants.MachineInstanceDir); err != nil {
+		return fmt.Errorf("Failed to delete crc machines directory: %w", err)
+	}
+	return nil
+}
diff --git a/pkg/crc/preflight/preflight_checks_darwin.go b/pkg/crc/preflight/preflight_checks_darwin.go
index a83214506..ec11236a6 100644
--- a/pkg/crc/preflight/preflight_checks_darwin.go
+++ b/pkg/crc/preflight/preflight_checks_darwin.go
@@ -3,9 +3,12 @@ package preflight
 import (
 	"fmt"
 	"os"
+	"os/exec"
 	"os/user"
+	"path/filepath"
 
 	"github.com/code-ready/crc/pkg/crc/cache"
+	"github.com/code-ready/crc/pkg/crc/constants"
 	"github.com/code-ready/crc/pkg/crc/logging"
 	"github.com/code-ready/crc/pkg/crc/network"
 	crcos "github.com/code-ready/crc/pkg/os"
@@ -182,3 +185,16 @@ func addFileWritePermissionToUser(filename string) error {
 
 	return nil
 }
+
+func stopCRCHyperkitProcess() error {
+	path, err := exec.LookPath("pkill")
+	if err != nil {
+		logging.Debugf("Could not find 'pkill'. %v", err)
+		return fmt.Errorf("Could not find 'pkill'. %w", err)
+	}
+	if _, _, err := crcos.RunWithDefaultLocale(path, "-f", filepath.Join(constants.CrcBinDir, "hyperkit")); err != nil {
+		logging.Debugf("Failed to kill 'hyperkit' process. %v", err)
+		return fmt.Errorf("Failed to kill 'hyperkit' process. %w", err)
+	}
+	return nil
+}
diff --git a/pkg/crc/preflight/preflight_checks_linux.go b/pkg/crc/preflight/preflight_checks_linux.go
index 2407a2232..d7ac48aa7 100644
--- a/pkg/crc/preflight/preflight_checks_linux.go
+++ b/pkg/crc/preflight/preflight_checks_linux.go
@@ -277,32 +277,6 @@ func fixMachineDriverLibvirtInstalled() error {
 	return nil
 }
 
-/* These 2 checks can be removed after a few releases */
-func checkOldMachineDriverLibvirtInstalled() error {
-	logging.Debugf("Checking if an older libvirt driver %s is installed", libvirt.MachineDriverCommand)
-	oldLibvirtDriverPath := filepath.Join("/usr/local/bin/", libvirt.MachineDriverCommand)
-	if _, err := os.Stat(oldLibvirtDriverPath); !os.IsNotExist(err) {
-		return fmt.Errorf("Found old system-wide crc-machine-driver executable")
-	}
-	logging.Debugf("No older %s installation found", libvirt.MachineDriverCommand)
-
-	return nil
-}
-
-func fixOldMachineDriverLibvirtInstalled() error {
-	oldLibvirtDriverPath := filepath.Join("/usr/local/bin/", libvirt.MachineDriverCommand)
-	logging.Debugf("Removing %s", oldLibvirtDriverPath)
-	_, _, err := crcos.RunWithPrivilege("remove old libvirt driver", "rm", "-f", oldLibvirtDriverPath)
-	if err != nil {
-		logging.Debugf("Removal of %s failed", oldLibvirtDriverPath)
-		/* Ignoring error, an obsolete file being still present is not a fatal error */
-	} else {
-		logging.Debugf("%s successfully removed", oldLibvirtDriverPath)
-	}
-
-	return nil
-}
-
 func checkLibvirtCrcNetworkAvailable() error {
 	logging.Debug("Checking if libvirt 'crc' network exists")
 	_, _, err := crcos.RunWithDefaultLocale("virsh", "--connect", "qemu:///system", "net-info", "crc")
@@ -385,13 +359,6 @@ func removeLibvirtCrcNetwork() error {
 }
 
 func removeCrcVM() error {
-	logging.Debug("Removing 'crc' VM")
-
-	if err := os.RemoveAll(constants.MachineInstanceDir); err != nil {
-		logging.Debugf("Error removing %s dir: %v", constants.MachineInstanceDir, err)
-		return fmt.Errorf("Error removing %s dir", constants.MachineInstanceDir)
-	}
-
 	stdout, _, err := crcos.RunWithDefaultLocale("virsh", "--connect", "qemu:///system", "domstate", constants.DefaultName)
 	if err != nil {
 		//  User may have run `crc delete` before `crc cleanup`
diff --git a/pkg/crc/preflight/preflight_checks_tray_windows.go b/pkg/crc/preflight/preflight_checks_tray_windows.go
index 7ba2f0fd9..501984608 100644
--- a/pkg/crc/preflight/preflight_checks_tray_windows.go
+++ b/pkg/crc/preflight/preflight_checks_tray_windows.go
@@ -115,8 +115,7 @@ func removeTray() error {
 
 	tempDir, err := ioutil.TempDir("", "crc")
 	if err != nil {
-		logging.Debug("Failed to create temporary directory for System Tray removal")
-		return nil
+		return err
 	}
 	defer func() {
 		_ = goos.RemoveAll(tempDir)
@@ -132,15 +131,14 @@ func removeTray() error {
 
 	// write script content to temporary file
 	if err = writePsScriptContentToFile(psScriptContent, psFilePath); err != nil {
-		logging.Debug(err)
-		return nil
+		return err
 	}
 
 	_, _, err = powershell.ExecuteAsAdmin("Uninstalling CodeReady Containers System Tray", psFilePath)
 	// wait for the script to finish executing
 	time.Sleep(2 * time.Second)
 	if err != nil {
-		logging.Debugf("Unable to execute System Tray uninstall script: %v", err)
+		return err
 	}
 	return nil
 }
diff --git a/pkg/crc/preflight/preflight_checks_windows.go b/pkg/crc/preflight/preflight_checks_windows.go
index 57cda6b33..111746f98 100644
--- a/pkg/crc/preflight/preflight_checks_windows.go
+++ b/pkg/crc/preflight/preflight_checks_windows.go
@@ -199,12 +199,6 @@ func removeDNSServerAddress() error {
 }
 
 func removeCrcVM() (err error) {
-	defer func() {
-		if ferr := os.RemoveAll(constants.MachineInstanceDir); ferr != nil {
-			logging.Debugf("Error removing %s dir: %v", constants.MachineInstanceDir, err)
-			err = fmt.Errorf("Error removing %s dir", constants.MachineInstanceDir)
-		}
-	}()
 	if _, _, err := powershell.Execute("Get-VM -Name crc"); err != nil {
 		// This means that there is no crc VM exist
 		return nil
diff --git a/pkg/crc/preflight/preflight_darwin.go b/pkg/crc/preflight/preflight_darwin.go
index 1ecf18ce7..0367f522f 100644
--- a/pkg/crc/preflight/preflight_darwin.go
+++ b/pkg/crc/preflight/preflight_darwin.go
@@ -23,6 +23,11 @@ func hyperkitPreflightChecks(networkMode network.Mode) []Check {
 			fixDescription:   "Installing crc-machine-hyperkit",
 			fix:              fixMachineDriverHyperKitInstalled(networkMode),
 		},
+		{
+			cleanupDescription: "Stopping CRC Hyperkit process",
+			cleanup:            stopCRCHyperkitProcess,
+			flags:              CleanUpOnly,
+		},
 	}
 }
 
diff --git a/pkg/crc/preflight/preflight_linux.go b/pkg/crc/preflight/preflight_linux.go
index 45a914ef7..21beeee5f 100644
--- a/pkg/crc/preflight/preflight_linux.go
+++ b/pkg/crc/preflight/preflight_linux.go
@@ -64,14 +64,6 @@ var libvirtPreflightChecks = [...]Check{
 		fixDescription:   "Installing crc-driver-libvirt",
 		fix:              fixMachineDriverLibvirtInstalled,
 	},
-	{
-		configKeySuffix:  "check-obsolete-libvirt-driver",
-		checkDescription: "Checking for obsolete crc-driver-libvirt",
-		check:            checkOldMachineDriverLibvirtInstalled,
-		fixDescription:   "Removing older system-wide crc-driver-libvirt",
-		fix:              fixOldMachineDriverLibvirtInstalled,
-		flags:            SetupOnly,
-	},
 	{
 		configKeySuffix:    "check-crc-network",
 		checkDescription:   "Checking if libvirt 'crc' network is available",


Test patch:
diff --git a/pkg/crc/preflight/preflight_darwin_test.go b/pkg/crc/preflight/preflight_darwin_test.go
index 9ede23027..417275452 100644
--- a/pkg/crc/preflight/preflight_darwin_test.go
+++ b/pkg/crc/preflight/preflight_darwin_test.go
@@ -16,9 +16,9 @@ func TestCountConfigurationOptions(t *testing.T) {
 }
 
 func TestCountPreflights(t *testing.T) {
-	assert.Len(t, getPreflightChecks(false, network.DefaultMode), 9)
-	assert.Len(t, getPreflightChecks(true, network.DefaultMode), 15)
+	assert.Len(t, getPreflightChecks(false, network.DefaultMode), 11)
+	assert.Len(t, getPreflightChecks(true, network.DefaultMode), 17)
 
-	assert.Len(t, getPreflightChecks(false, network.VSockMode), 8)
-	assert.Len(t, getPreflightChecks(true, network.VSockMode), 14)
+	assert.Len(t, getPreflightChecks(false, network.VSockMode), 10)
+	assert.Len(t, getPreflightChecks(true, network.VSockMode), 16)
 }
diff --git a/pkg/crc/preflight/preflight_linux_test.go b/pkg/crc/preflight/preflight_linux_test.go
index 1035b983b..c8664d09d 100644
--- a/pkg/crc/preflight/preflight_linux_test.go
+++ b/pkg/crc/preflight/preflight_linux_test.go
@@ -13,7 +13,7 @@ func TestCountConfigurationOptions(t *testing.T) {
 	cfg := config.New(config.NewEmptyInMemoryStorage())
 	RegisterSettings(cfg)
 	options := len(cfg.AllConfigs())
-	assert.True(t, options == 40 || options == 32)
+	assert.True(t, options == 38 || options == 30)
 }
 
 func TestCountPreflights(t *testing.T) {
diff --git a/pkg/crc/preflight/preflight_windows_test.go b/pkg/crc/preflight/preflight_windows_test.go
index 0fd3db1b5..b9e84e819 100644
--- a/pkg/crc/preflight/preflight_windows_test.go
+++ b/pkg/crc/preflight/preflight_windows_test.go
@@ -15,9 +15,9 @@ func TestCountConfigurationOptions(t *testing.T) {
 }
 
 func TestCountPreflights(t *testing.T) {
-	assert.Len(t, getPreflightChecks(false, network.DefaultMode), 13)
-	assert.Len(t, getPreflightChecks(true, network.DefaultMode), 15)
+	assert.Len(t, getPreflightChecks(false, network.DefaultMode), 14)
+	assert.Len(t, getPreflightChecks(true, network.DefaultMode), 16)
 
-	assert.Len(t, getPreflightChecks(false, network.VSockMode), 14)
-	assert.Len(t, getPreflightChecks(true, network.VSockMode), 16)
+	assert.Len(t, getPreflightChecks(false, network.VSockMode), 15)
+	assert.Len(t, getPreflightChecks(true, network.VSockMode), 17)
 }
diff --git a/test/integration/features/basic.feature b/test/integration/features/basic.feature
index 049413e7b..33f4f9b36 100644
--- a/test/integration/features/basic.feature
+++ b/test/integration/features/basic.feature
@@ -45,7 +45,6 @@ Feature: Basic test
         And stderr should contain "Checking if user is part of libvirt group"
         And stderr should contain "Checking if libvirt daemon is running"
         And stderr should contain "Checking if a supported libvirt version is installed"
-        And stderr should contain "Checking for obsolete crc-driver-libvirt"
         And stderr should contain "Checking if libvirt 'crc' network is available"
         And stderr should contain "Checking if libvirt 'crc' network is active"
         And stderr should contain "Checking if NetworkManager is installed"