From d9caf9b25585276a1008f73787a70331a5e0d0c2 Mon Sep 17 00:00:00 2001 From: lilyLuLiu Date: Mon, 16 Dec 2024 15:47:12 +0800 Subject: [PATCH] Change linux default network-mode to user --- pkg/crc/config/settings.go | 5 +---- pkg/crc/network/types.go | 10 ++-------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/pkg/crc/config/settings.go b/pkg/crc/config/settings.go index d4236d6a5c..6e0c0b3540 100644 --- a/pkg/crc/config/settings.go +++ b/pkg/crc/config/settings.go @@ -168,10 +168,7 @@ func GetPreset(config Storage) preset.Preset { } func defaultNetworkMode() network.Mode { - if runtime.GOOS != "linux" { - return network.UserNetworkingMode - } - return network.SystemNetworkingMode + return network.UserNetworkingMode } func GetNetworkMode(config Storage) network.Mode { diff --git a/pkg/crc/network/types.go b/pkg/crc/network/types.go index 0f5f823af9..5919ed4c80 100644 --- a/pkg/crc/network/types.go +++ b/pkg/crc/network/types.go @@ -2,7 +2,6 @@ package network import ( "fmt" - "runtime" "github.com/crc-org/crc/v2/pkg/crc/logging" "github.com/spf13/cast" @@ -55,7 +54,7 @@ func parseMode(input string) (Mode, error) { case string(SystemNetworkingMode), "default": return SystemNetworkingMode, nil default: - return SystemNetworkingMode, fmt.Errorf("Cannot parse mode '%s'", input) + return UserNetworkingMode, fmt.Errorf("Cannot parse mode '%s'", input) } } func ParseMode(input string) Mode { @@ -68,12 +67,7 @@ func ParseMode(input string) Mode { } func getDefaultMode() Mode { - switch runtime.GOOS { - case "linux": - return SystemNetworkingMode - default: - return UserNetworkingMode - } + return UserNetworkingMode } func ValidateMode(val interface{}) (bool, string) {