-
Notifications
You must be signed in to change notification settings - Fork 618
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
dockerstate: map keys differ before create #1033
Changes from all commits
f3af574
7b56419
1a47e4e
fa0662e
81b8672
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 |
---|---|---|
|
@@ -166,8 +166,12 @@ func (agent *TestAgent) StartAgent() error { | |
Links: agent.Options.ContainerLinks, | ||
} | ||
|
||
if os.Getenv("ECS_FTEST_FORCE_NET_HOST") != "" { | ||
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. Where is this environment variable being set? 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. It's not automatically set. I added this because I was developing the test in an environment where the docker0 bridge did not have Internet access (for unrelated reasons) and wanted the agent to actually be able to run. 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. Then can you add this into the 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. Done. I rewrote a bit more of the README to make it more clear. |
||
hostConfig.NetworkMode = "host" | ||
} | ||
|
||
if agent.Options != nil { | ||
// Override the default docker envrionment variable | ||
// Override the default docker environment variable | ||
for key, value := range agent.Options.ExtraEnvironment { | ||
envVarExists := false | ||
for i, str := range dockerConfig.Env { | ||
|
@@ -207,12 +211,17 @@ func (agent *TestAgent) StartAgent() error { | |
if err != nil { | ||
return errors.New("Could not inspect agent container: " + err.Error()) | ||
} | ||
agent.IntrospectionURL = "http://localhost:" + containerMetadata.NetworkSettings.Ports["51678/tcp"][0].HostPort | ||
if containerMetadata.HostConfig.NetworkMode == "host" { | ||
agent.IntrospectionURL = "http://localhost:51678" | ||
} else { | ||
agent.IntrospectionURL = "http://localhost:" + containerMetadata.NetworkSettings.Ports["51678/tcp"][0].HostPort | ||
} | ||
|
||
return agent.verifyIntrospectionAPI() | ||
} | ||
|
||
// getBindMounts actually constructs volume binds for container's host config | ||
// It also additionally checks for envrionment variables: | ||
// It also additionally checks for environment variables: | ||
// * CGROUP_PATH: the cgroup path | ||
// * EXECDRIVER_PATH: the path of metrics | ||
func (agent *TestAgent) getBindMounts() []string { | ||
|
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.
minor: remove this? Or use a logger?
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.
fmt.Println
will print out immediately (when running tests for a single package) whilet.Log
buffers until the test ends. I had wanted to print this out during the run so I could inspect the agent logs while it was sleeping. I'm inclined to leave this in right now, but I can remove it if you feel strongly.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.
Nah, you can leave this be. It's functional tests and it doesn't matter if log out to stdout here immediately.