-
Notifications
You must be signed in to change notification settings - Fork 256
Add Config to Disable Hosts File Modification #4938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,8 +33,12 @@ type resolverFileValues struct { | |
|
|
||
| func runPostStartForOS(serviceConfig services.ServicePostStartConfig) error { | ||
| // Update /etc/hosts file for host | ||
| if err := addOpenShiftHosts(serviceConfig); err != nil { | ||
| return err | ||
| if serviceConfig.ModifyHostsFile { | ||
| if err := addOpenShiftHosts(serviceConfig); err != nil { | ||
| return err | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. - }
+ } else {
+ logging.Infof("Skipping hosts file modification")
+ }
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ... this of course applies to all the platforms (also
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gbraad Thank you for your time and the review. I applied your suggestions and also the other two nitpicks by coderabbitai. |
||
| } else { | ||
| logging.Infof("Skipping hosts file modification") | ||
| } | ||
|
|
||
| if serviceConfig.NetworkMode == network.UserNetworkingMode { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,18 @@ | ||
| package dns | ||
|
|
||
| import ( | ||
| "github.com/crc-org/crc/v2/pkg/crc/logging" | ||
| "github.com/crc-org/crc/v2/pkg/crc/services" | ||
| ) | ||
|
|
||
| func runPostStartForOS(serviceConfig services.ServicePostStartConfig) error { | ||
| // We might need to set the firewall here to forward | ||
| // Update /etc/hosts file for host | ||
| return addOpenShiftHosts(serviceConfig) | ||
| if serviceConfig.ModifyHostsFile { | ||
| return addOpenShiftHosts(serviceConfig) | ||
| } | ||
|
|
||
| logging.Infof("Skipping hosts file modification because 'modify-hosts-file' is set to false") | ||
|
|
||
| return nil | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.