Skip to content

Commit

Permalink
Issue crc-org#838 Remove virtualbox driver support
Browse files Browse the repository at this point in the history
  • Loading branch information
gbraad authored and cfergeau committed Dec 10, 2019
1 parent fc30212 commit 589fd8c
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 65 deletions.
4 changes: 1 addition & 3 deletions pkg/crc/machine/client/client_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand All @@ -16,7 +14,7 @@ func StartDriver() {
driverName := os.Getenv(localbinary.PluginEnvDriverName)
switch driverName {
case "virtualbox":
plugin.RegisterDriver(virtualbox.NewDriver("", ""))
errors.ExitWithMessage(1, "VirtualBox support is no longer available\n")
default:
errors.ExitWithMessage(1, fmt.Sprintf("Unregistered driver: %s\n", driverName))
}
Expand Down
5 changes: 2 additions & 3 deletions pkg/crc/machine/client/client_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +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"
)
Expand All @@ -16,10 +15,10 @@ 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("", ""))
case "virtualbox":
errors.ExitWithMessage(1, "VirtualBox support is no longer available\n")
default:
errors.ExitWithMessage(1, fmt.Sprintf("Unregistered driver: %s\n", driverName))
}
Expand Down
14 changes: 2 additions & 12 deletions pkg/crc/machine/driver_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -19,15 +17,8 @@ func init() {
DriverPath: constants.CrcBinDir,
}

VirtualBoxMacOSDriver := MachineDriver{
Name: "VirtualBox",
Platform: crcos.DARWIN,
Driver: "virtualbox",
}

SupportedDrivers = []MachineDriver{
HyperkitDriver,
VirtualBoxMacOSDriver,
}

DefaultDriver = HyperkitDriver
Expand All @@ -39,12 +30,11 @@ 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)

case "virtualbox":
errors.ExitWithMessage(1, "VirtualBox support is no longer available\n")
default:
errors.ExitWithMessage(1, "Unsupported driver: %s", machineConfig.VMDriver)
}
Expand Down
14 changes: 2 additions & 12 deletions pkg/crc/machine/driver_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -17,15 +15,8 @@ func init() {
Driver: "hyperv",
}

VirtualBoxWindowsDriver := MachineDriver{
Name: "VirtualBox",
Platform: crcos.WINDOWS,
Driver: "virtualbox",
}

SupportedDrivers = []MachineDriver{
HyperVDriver,
VirtualBoxWindowsDriver,
}

DefaultDriver = HyperVDriver
Expand All @@ -37,12 +28,11 @@ 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)

case "virtualbox":
errors.ExitWithMessage(1, "VirtualBox support is no longer available\n")
default:
errors.ExitWithMessage(1, "Unsupported driver: %s", machineConfig.VMDriver)
}
Expand Down
29 changes: 0 additions & 29 deletions pkg/crc/machine/virtualbox/driver.go

This file was deleted.

6 changes: 0 additions & 6 deletions pkg/crc/services/dns/dns_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 589fd8c

Please sign in to comment.