Improved detection of router container restart
Use the container name in addition to the entrypoint to avoid triggering reattachment unnecessarily.
This commit is contained in:
1 parent
94d7f33a03
commit
4792fe6391
2 files changed
+3
-1
No files matched your search
@@ -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) {
|
||||
|
||||
+2
-1
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user