-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix an issue where settings were not taking effect #197
Conversation
achanda
commented
Oct 2, 2015
- This fixes docker: setting network mode is not working #196
- Also delegates default mode selection to docker
mode, ok := task.Config["network_mode"] | ||
if !ok || mode == "" { | ||
// docker default | ||
logger.Printf("[WARN] driver.docker: no mode specified for networking, defaulting to bridge") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"defaulting to bridge" should probably change to "using Docker default" or something, since we're no longer actually specifying bridge
here
This looks fine to me, other than a comment. I'm curious, re: #196, do you recall (or can you reproduce) which message was logged? Looks like one of these:
Knowing which one, and what specific |
@catsby the second one was being printed with |
- This fixes #196 - Also delegates default mode selection to docker
@@ -76,6 +76,22 @@ func (d *DockerDriver) Fingerprint(cfg *config.Config, node *structs.Node) (bool | |||
func createHostConfig(task *structs.Task) *docker.HostConfig { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pass the logger into this method.
Please also run go-fmt on the code. |
logger.Printf("[DEBUG] driver.docker: using %s as network mode", mode) | ||
default: | ||
logger.Printf("[WARN] invalid setting for network mode %s, defaulting to bridge mode on docker0", mode) | ||
mode = "default" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should either set the mode to "bridge", or change the message to say "using default network mode on docker0".
@ryanuber @dadgar @catsby I think I figured out why my original patch did not work. |
I will close this one and fix this in another PR. |
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |