Skip to content

Commit

Permalink
Change linux default network-mode to user
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyLuLiu committed Dec 31, 2024
1 parent 1af1620 commit d9caf9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
5 changes: 1 addition & 4 deletions pkg/crc/config/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 2 additions & 8 deletions pkg/crc/network/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package network

import (
"fmt"
"runtime"

"github.com/crc-org/crc/v2/pkg/crc/logging"
"github.com/spf13/cast"
Expand Down Expand Up @@ -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 {
Expand All @@ -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) {
Expand Down

0 comments on commit d9caf9b

Please sign in to comment.