Commit Graph

5 Commits

Author SHA1 Message Date
Doug Davis 8b454dd79e Add a "context" to the api/server/* code
This defines a 'context' object that is passed to each API handler.
Right now the context just has a unique 'requestID' for each API call.
The next steps would be:
- use this 'requestID' in our logging.
- determine the best way to format the logging to include this info.

In particular for log events that generate multiple entries in the log
we can use the requestID to help correlate the log entries.

Adding the requestID to the logging will be a challenge since it could mean
changing every single logrus.XXX() call to pass in the 'context' object.

But first step is to agree on a format, which we can discus in a subsequent
PR, but my initial thoughts are to add it right after the timestamp:

current format:
INFO[0039] POST /v1.21/build?buildargs=%7B%22foo%22%3A%22xxx%22%7D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&memory=0&memswap=0&rm=1&t=&ulimits=null

proposed format:
INFO[0039-83dea1222191] POST /v1.21/build?buildargs=%7B%22foo%22%3A%22xxx%22%7D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&memory=0&memswap=0&rm=1&t=&ulimits=null

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-09-09 12:51:20 -07:00
Shijiang Wei fcf9daad91 fix a panic when the exec fails to start
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2015-08-22 00:01:44 +08:00
Brian Goff 5ffcecf130 Fix issue with exec TTY caused by 15446
The bool logic around setting up the TTY ended up getting flipped
accidentally.
Also added a test for exec with TTY.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-08-14 14:55:26 -07:00
Brian Goff f078f75bf2 Return better errors from exec
Also cleans up some of the API side of exec.
Was writing the header twice (two different headers).

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-08-10 09:53:19 -04:00
Brian Goff 1a77580030 Split API handlers into domain specific files
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-08-03 11:12:44 -04:00