diff --git a/pkg/crc/machine/client/client_darwin.go b/pkg/crc/machine/client/client_darwin.go index be0c7c4c9c..623ddde920 100644 --- a/pkg/crc/machine/client/client_darwin.go +++ b/pkg/crc/machine/client/client_darwin.go @@ -5,8 +5,6 @@ import ( "os" "github.com/code-ready/crc/pkg/crc/errors" - "github.com/code-ready/machine/drivers/virtualbox" - "github.com/code-ready/machine/libmachine/drivers/plugin" "github.com/code-ready/machine/libmachine/drivers/plugin/localbinary" ) @@ -15,8 +13,6 @@ func StartDriver() { if os.Getenv(localbinary.PluginEnvKey) == localbinary.PluginEnvVal { driverName := os.Getenv(localbinary.PluginEnvDriverName) switch driverName { - case "virtualbox": - plugin.RegisterDriver(virtualbox.NewDriver("", "")) default: errors.ExitWithMessage(1, fmt.Sprintf("Unregistered driver: %s\n", driverName)) } diff --git a/pkg/crc/machine/client/client_windows.go b/pkg/crc/machine/client/client_windows.go index 83431b3837..eb709aad1b 100644 --- a/pkg/crc/machine/client/client_windows.go +++ b/pkg/crc/machine/client/client_windows.go @@ -6,8 +6,6 @@ import ( "github.com/code-ready/crc/pkg/crc/errors" "github.com/code-ready/machine/drivers/hyperv" - "github.com/code-ready/machine/drivers/virtualbox" - "github.com/code-ready/machine/libmachine/drivers/plugin" "github.com/code-ready/machine/libmachine/drivers/plugin/localbinary" ) @@ -16,8 +14,6 @@ func StartDriver() { if os.Getenv(localbinary.PluginEnvKey) == localbinary.PluginEnvVal { driverName := os.Getenv(localbinary.PluginEnvDriverName) switch driverName { - case "virtualbox": - plugin.RegisterDriver(virtualbox.NewDriver("", "")) case "hyperv": plugin.RegisterDriver(hyperv.NewDriver("", "")) default: diff --git a/pkg/crc/machine/driver_darwin.go b/pkg/crc/machine/driver_darwin.go index 981d59440f..59cc99a4da 100644 --- a/pkg/crc/machine/driver_darwin.go +++ b/pkg/crc/machine/driver_darwin.go @@ -3,12 +3,10 @@ package machine import ( "github.com/code-ready/crc/pkg/crc/constants" "github.com/code-ready/crc/pkg/crc/errors" - "github.com/code-ready/crc/pkg/crc/logging" crcos "github.com/code-ready/crc/pkg/os" "github.com/code-ready/crc/pkg/crc/machine/config" "github.com/code-ready/crc/pkg/crc/machine/hyperkit" - "github.com/code-ready/crc/pkg/crc/machine/virtualbox" ) func init() { @@ -19,15 +17,8 @@ func init() { DriverPath: constants.CrcBinDir, } - VirtualBoxMacOSDriver := MachineDriver{ - Name: "VirtualBox", - Platform: crcos.DARWIN, - Driver: "virtualbox", - } - SupportedDrivers = []MachineDriver{ HyperkitDriver, - VirtualBoxMacOSDriver, } DefaultDriver = HyperkitDriver @@ -39,9 +30,6 @@ func getDriverOptions(machineConfig config.MachineConfig) interface{} { // Supported drivers switch machineConfig.VMDriver { - case "virtualbox": - logging.Warn("Virtualbox support is deprecated and will be removed in the next release.") - driver = virtualbox.CreateHost(machineConfig) case "hyperkit": driver = hyperkit.CreateHost(machineConfig) diff --git a/pkg/crc/machine/driver_windows.go b/pkg/crc/machine/driver_windows.go index 029dcc5f9c..571ec93ca8 100644 --- a/pkg/crc/machine/driver_windows.go +++ b/pkg/crc/machine/driver_windows.go @@ -2,12 +2,10 @@ package machine import ( "github.com/code-ready/crc/pkg/crc/errors" - "github.com/code-ready/crc/pkg/crc/logging" crcos "github.com/code-ready/crc/pkg/os" "github.com/code-ready/crc/pkg/crc/machine/config" "github.com/code-ready/crc/pkg/crc/machine/hyperv" - "github.com/code-ready/crc/pkg/crc/machine/virtualbox" ) func init() { @@ -17,15 +15,8 @@ func init() { Driver: "hyperv", } - VirtualBoxWindowsDriver := MachineDriver{ - Name: "VirtualBox", - Platform: crcos.WINDOWS, - Driver: "virtualbox", - } - SupportedDrivers = []MachineDriver{ HyperVDriver, - VirtualBoxWindowsDriver, } DefaultDriver = HyperVDriver @@ -37,9 +28,6 @@ func getDriverOptions(machineConfig config.MachineConfig) interface{} { // Supported drivers switch machineConfig.VMDriver { - case "virtualbox": - logging.Warn("Virtualbox support is deprecated and will be removed in the next release.") - driver = virtualbox.CreateHost(machineConfig) case "hyperv": driver = hyperv.CreateHost(machineConfig) diff --git a/pkg/crc/machine/virtualbox/driver.go b/pkg/crc/machine/virtualbox/driver.go deleted file mode 100644 index 64a561f765..0000000000 --- a/pkg/crc/machine/virtualbox/driver.go +++ /dev/null @@ -1,29 +0,0 @@ -package virtualbox - -import ( - "path/filepath" - - "github.com/code-ready/crc/pkg/crc/constants" - "github.com/code-ready/machine/drivers/virtualbox" - - "github.com/code-ready/crc/pkg/crc/machine/config" -) - -func CreateHost(machineConfig config.MachineConfig) *virtualbox.Driver { - virtualboxDriver := virtualbox.NewDriver(machineConfig.Name, constants.MachineBaseDir) - - virtualboxDriver.CPU = machineConfig.CPUs - virtualboxDriver.BundleName = machineConfig.BundleName - virtualboxDriver.Memory = machineConfig.Memory - - // Network - virtualboxDriver.HostOnlyCIDR = "192.168.130.1/24" - - // DiskPath should come from the bundle's metadata (unflattened) - // This force to add entry of DiskPath under crc machine config.json - virtualboxDriver.DiskPath = filepath.Join(constants.MachineBaseDir, "machines", machineConfig.Name, constants.DefaultDiskImage) - virtualboxDriver.DiskPathUrl = machineConfig.DiskPathURL - virtualboxDriver.SSHKeyPath = machineConfig.SSHKeyPath - - return virtualboxDriver -} diff --git a/pkg/crc/services/dns/dns_windows.go b/pkg/crc/services/dns/dns_windows.go index cbed338072..672ad124a0 100644 --- a/pkg/crc/services/dns/dns_windows.go +++ b/pkg/crc/services/dns/dns_windows.go @@ -20,12 +20,6 @@ const ( ) func runPostStartForOS(serviceConfig services.ServicePostStartConfig, result *services.ServicePostStartResult) (services.ServicePostStartResult, error) { - // bailout for Virtualbox - if serviceConfig.DriverName == "virtualbox" { - result.Success = true - return *result, nil - } - _, switchName := winnet.SelectSwitchByNameOrDefault(AlternativeNetwork) networkInterface := fmt.Sprintf("vEthernet (%s)", switchName)