mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
engine: catchall handler is shadowed by specific handlers
This allows using `Engine.Register` and `Engine.RegisterCatchall` on the same engine without the catchall hiding all other handlers. Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
This commit is contained in:
parent
103d028132
commit
de75af9fe2
1 changed files with 5 additions and 6 deletions
|
@ -118,13 +118,12 @@ func (eng *Engine) Job(name string, args ...string) *Job {
|
|||
if eng.Logging {
|
||||
job.Stderr.Add(utils.NopWriteCloser(eng.Stderr))
|
||||
}
|
||||
if eng.catchall != nil {
|
||||
|
||||
// Catchall is shadowed by specific Register.
|
||||
if handler, exists := eng.handlers[name]; exists {
|
||||
job.handler = handler
|
||||
} else if eng.catchall != nil {
|
||||
job.handler = eng.catchall
|
||||
} else {
|
||||
handler, exists := eng.handlers[name]
|
||||
if exists {
|
||||
job.handler = handler
|
||||
}
|
||||
}
|
||||
return job
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue