Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Improved detection of router container restart
Browse files Browse the repository at this point in the history
Use the container name in addition to the entrypoint to avoid triggering
reattachment unnecessarily.
  • Loading branch information
awh committed Oct 27, 2015
1 parent 94d7f33 commit 4792fe6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions proxy/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var (
containerIDRegexp = regexp.MustCompile("^(/v[0-9\\.]*)?/containers/([^/]*)/.*")
weaveWaitEntrypoint = []string{"/w/w"}
weaveEntrypoint = "/home/weave/weaver"
weaveContainerName = "/weave"
)

func callWeave(args ...string) ([]byte, []byte, error) {
Expand Down
3 changes: 2 additions & 1 deletion proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,8 @@ func containerShouldAttach(container *docker.Container) bool {
}

func containerIsWeaveRouter(container *docker.Container) bool {
return len(container.Config.Entrypoint) > 0 && container.Config.Entrypoint[0] == weaveEntrypoint
return container.Name == weaveContainerName &&
len(container.Config.Entrypoint) > 0 && container.Config.Entrypoint[0] == weaveEntrypoint
}

func (proxy *Proxy) createWait(r *http.Request, ident string) {
Expand Down

0 comments on commit 4792fe6

Please sign in to comment.