-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 client restart behavior for Connect #6315
Conversation
b3a1aa6
to
09585ab
Compare
7778ab6
to
fff3b4c
Compare
fff3b4c
to
53ab5f9
Compare
All: true, | ||
}) | ||
|
||
container, err := d.containerByName(config.Name) |
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.
Note for reviewers: I refactored this big chunk of logic in createContainer
out to containerByName
because I wanted to reuse it in CreateNetwork
. We want callers to be able to determine what to do if the container already existed.
@nickethier and @schmichael it looks like I've got this working, so this should be ready for review. I've tested out both client restarts and job stops by hand, and run the included e2e test:
|
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.
Only blocker is the question about os.Remove handling in consulsock hook.
53ab5f9
to
7ee8efb
Compare
@nickethier this should be ready for re-review. |
} | ||
|
||
container, err := d.createContainer(client, *config, d.config.InfraImage) | ||
specFromContainer := func(c *docker.Container) *drivers.NetworkIsolationSpec { |
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.
You could probably just create container
here and skip the func, but this is a neat way to skip memory allocations for structs that may not be used.
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.
I was a little wary of creating a partial NetworkIsolationSpec
and then populating the fields later just because it's the sort of thing that's easy for someone to come along later and return it early and expose a nil pointer exception in a field access. If you think the indirection of the function here isn't idiomatic I'd be happy to change it though.
5241f8f
to
fb07ec5
Compare
fb07ec5
to
1666635
Compare
The appveyor failure looks like a flake |
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. |
Fixes #6310
I've pulled the test infrastructure work this requires out into #6313 and #6314 to keep the diff size reasonable.
(Unit tests / linting won't pass till those are merged.)Done.This fixes the client restart bug by:
cc @nickethier @schmichael