Merge pull request #596 from mrunalp/ctr_create_debug
oci: Add debugs to print error message on create failure
This commit is contained in:
commit
00444753e7
2 changed files with 4 additions and 2 deletions
|
@ -19,5 +19,5 @@ for d in $(find . -type d -not -iwholename '*.git*' -a -not -iname '.tool' -a -n
|
|||
--cyclo-over=80 \
|
||||
--dupl-threshold=100 \
|
||||
--tests \
|
||||
--deadline=120s "${d}"
|
||||
--deadline=600s "${d}"
|
||||
done
|
||||
|
|
|
@ -180,7 +180,7 @@ func (r *Runtime) CreateContainer(c *Container, cgroupParent string) error {
|
|||
if ss.err != nil {
|
||||
return fmt.Errorf("error reading container (probably exited) json message: %v", ss.err)
|
||||
}
|
||||
logrus.Infof("Received container pid: %d", ss.si.Pid)
|
||||
logrus.Debugf("Received container pid: %d", ss.si.Pid)
|
||||
errorMessage := ""
|
||||
if c.terminal {
|
||||
errorMessage = stderrBuf.String()
|
||||
|
@ -194,8 +194,10 @@ func (r *Runtime) CreateContainer(c *Container, cgroupParent string) error {
|
|||
|
||||
if ss.si.Pid == -1 {
|
||||
if errorMessage != "" {
|
||||
logrus.Debugf("Container creation error: %s", errorMessage)
|
||||
return fmt.Errorf("container create failed: %s", errorMessage)
|
||||
}
|
||||
logrus.Debugf("Container creation failed")
|
||||
return fmt.Errorf("container create failed")
|
||||
}
|
||||
case <-time.After(ContainerCreateTimeout):
|
||||
|
|
Loading…
Reference in a new issue