Skip to content

Commit

Permalink
Force macOS pkg to use user networking mode
Browse files Browse the repository at this point in the history
Keep the system networking mode for the fat binary.
  • Loading branch information
guillaumerose authored and praveenkumar committed Jun 25, 2021
1 parent d500c19 commit 424c161
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pkg/crc/config/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,12 @@ func RegisterSettings(cfg *Config) {
"Disable update check (true/false, default: false)")
cfg.AddSetting(ExperimentalFeatures, false, ValidateBool, SuccessfullyApplied,
"Enable experimental features (true/false, default: false)")
cfg.AddSetting(NetworkMode, string(defaultNetworkMode()), network.ValidateMode, network.SuccessfullyAppliedMode,
fmt.Sprintf("Network mode (%s or %s)", network.UserNetworkingMode, network.SystemNetworkingMode))

if !version.IsMacosInstallPathSet() {
cfg.AddSetting(NetworkMode, string(defaultNetworkMode()), network.ValidateMode, network.SuccessfullyAppliedMode,
fmt.Sprintf("Network mode (%s or %s)", network.UserNetworkingMode, network.SystemNetworkingMode))
}

cfg.AddSetting(HostNetworkAccess, false, validateHostNetworkAccess, SuccessfullyApplied,
"Allow TCP/IP connections from the CodeReady Containers VM to services running on the host (true/false, default: false)")
// System tray auto-start config
Expand Down Expand Up @@ -118,5 +122,8 @@ func defaultNetworkMode() network.Mode {
}

func GetNetworkMode(config Storage) network.Mode {
if version.IsMacosInstallPathSet() {
return network.UserNetworkingMode
}
return network.ParseMode(config.Get(NetworkMode).AsString())
}

0 comments on commit 424c161

Please sign in to comment.