Merge pull request #4571 from fidencio/topic/stable-2.4-set-status-if-wait-process-failed

stable-2.4 | shim: set a non-zero return code if the wait process call failed.
This commit is contained in:
GabyCT
2022-07-01 11:28:35 -05:00
committed by GitHub
2 changed files with 6 additions and 1 deletions

View File

@@ -53,6 +53,11 @@ func wait(ctx context.Context, s *service, c *container, execID string) (int32,
"container": c.id,
"pid": processID,
}).Error("Wait for process failed")
// set return code if wait failed
if ret == 0 {
ret = exitCode255
}
}
timeStamp := time.Now()

View File

@@ -1593,7 +1593,7 @@ func (s *Sandbox) ResumeContainer(ctx context.Context, containerID string) error
}
// createContainers registers all containers, create the
// containers in the guest and starts one shim per container.
// containers in the guest.
func (s *Sandbox) createContainers(ctx context.Context) error {
span, ctx := katatrace.Trace(ctx, s.Logger(), "createContainers", sandboxTracingTags, map[string]string{"sandbox_id": s.id})
defer span.End()