mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-03 20:21:44 +00:00
Merge pull request #16366 from MHBauer/logs-refactor
refactor logs to not use internal data structures
This commit is contained in:
@@ -116,9 +116,10 @@ func (s *router) getContainersLogs(ctx context.Context, w http.ResponseWriter, r
|
||||
closeNotifier = notifier.CloseNotify()
|
||||
}
|
||||
|
||||
c, err := s.daemon.Get(vars["name"])
|
||||
if err != nil {
|
||||
return err
|
||||
containerName := vars["name"]
|
||||
|
||||
if !s.daemon.Exists(containerName) {
|
||||
return derr.ErrorCodeNoSuchContainer.WithArgs(containerName)
|
||||
}
|
||||
|
||||
outStream := ioutils.NewWriteFlusher(w)
|
||||
@@ -138,7 +139,7 @@ func (s *router) getContainersLogs(ctx context.Context, w http.ResponseWriter, r
|
||||
Stop: closeNotifier,
|
||||
}
|
||||
|
||||
if err := s.daemon.ContainerLogs(c, logsConfig); err != nil {
|
||||
if err := s.daemon.ContainerLogs(containerName, logsConfig); err != nil {
|
||||
// The client may be expecting all of the data we're sending to
|
||||
// be multiplexed, so send it through OutStream, which will
|
||||
// have been set up to handle that if needed.
|
||||
|
||||
Reference in New Issue
Block a user