Skip to content

Commit

Permalink
Fix config change msg for config setting 'host-network-access'
Browse files Browse the repository at this point in the history
changes to 'host-network-access' only works when the daemon is restarted
for this to happen user needs to run 'crc cleanup' and then  'crc setup'

this adds a new function 'RequiresCleanupAndSetupMsg' config package
  • Loading branch information
anjannath committed Oct 11, 2022
1 parent f78e807 commit a1ff049
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pkg/crc/config/callbacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ func RequiresCRCSetup(key string, _ interface{}) string {
"Please run 'crc setup' for this configuration to take effect.", key)
}

func RequiresCleanupAndSetupMsg(key string, _ interface{}) string {
return fmt.Sprintf("Changes to configuration property '%s' are only applied during 'crc setup'.\n"+
"Please run 'crc cleanup' followed by 'crc setup' for this configuration to take effect.", key)
}

func RequiresHTTPPortChangeWarning(key string, value interface{}) string {
return fmt.Sprintf("Changes to configuration property '%s' will break OpenShift HTTP routes.\n"+
"In order to access OpenShift applications through HTTP URLs "+
Expand Down
2 changes: 1 addition & 1 deletion pkg/crc/config/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func RegisterSettings(cfg *Config) {
fmt.Sprintf("Network mode (%s or %s)", network.UserNetworkingMode, network.SystemNetworkingMode))
}

cfg.AddSetting(HostNetworkAccess, false, validateHostNetworkAccess, SuccessfullyApplied,
cfg.AddSetting(HostNetworkAccess, false, validateHostNetworkAccess, RequiresCleanupAndSetupMsg,
"Allow TCP/IP connections from the CRC VM to services running on the host (true/false, default: false)")
// Proxy Configuration
cfg.AddSetting(HTTPProxy, "", ValidateHTTPProxy, SuccessfullyApplied,
Expand Down

0 comments on commit a1ff049

Please sign in to comment.