mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-05 05:01:28 +00:00
Make exec start return proper error codes
Exec start was sending HTTP 500 for every error. Fixed an error where pausing a container and then calling exec start caused the daemon to freeze. Updated API docs which incorrectly showed that a successful exec start was an HTTP 201, in reality it is HTTP 200. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
@@ -75,6 +75,10 @@ func (s *router) postContainerExecStart(ctx context.Context, w http.ResponseWrit
|
||||
return err
|
||||
}
|
||||
|
||||
if exists, err := s.daemon.ExecExists(execName); !exists {
|
||||
return err
|
||||
}
|
||||
|
||||
if !execStartCheck.Detach {
|
||||
var err error
|
||||
// Setting up the streaming http interface.
|
||||
@@ -102,6 +106,9 @@ func (s *router) postContainerExecStart(ctx context.Context, w http.ResponseWrit
|
||||
|
||||
// Now run the user process in container.
|
||||
if err := s.daemon.ContainerExecStart(execName, stdin, stdout, stderr); err != nil {
|
||||
if execStartCheck.Detach {
|
||||
return err
|
||||
}
|
||||
fmt.Fprintf(outStream, "Error running exec in container: %v\n", err)
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user