mirror of https://github.com/docker/docs.git
Fix a panic that occurs in the log handler when pulling images.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
parent
86a028d7c1
commit
acd036365d
|
@ -22,7 +22,12 @@ type logHandler struct {
|
|||
}
|
||||
|
||||
func (h *logHandler) Handle(e *cluster.Event) error {
|
||||
log.WithFields(log.Fields{"node": e.Node.Name, "id": e.Id[:12], "from": e.From, "status": e.Status}).Debug("Event received")
|
||||
id := e.Id
|
||||
// Trim IDs to 12 chars.
|
||||
if len(id) > 12 {
|
||||
id = id[:12]
|
||||
}
|
||||
log.WithFields(log.Fields{"node": e.Node.Name, "id": id, "from": e.From, "status": e.Status}).Debug("Event received")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue