Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions internal/oci/runtime_oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ func (r *runtimeOCI) CreateContainer(ctx context.Context, c *Container, cgroupPa

// Platform specific container setup
if err := r.createContainerPlatform(c, cgroupParent, cmd.Process.Pid); err != nil {
if waitErr := cmd.Wait(); waitErr != nil {
return errors.Wrap(err, waitErr.Error())
}
return err
}

Expand Down Expand Up @@ -374,6 +377,9 @@ func (r *runtimeOCI) ExecContainer(ctx context.Context, c *Container, cmd []stri
// The read side of the pipe should be closed after the container process has been started.
if r != nil {
if err := r.Close(); err != nil {
if waitErr := execCmd.Wait(); waitErr != nil {
return errors.Wrap(err, waitErr.Error())
}
return err
}
}
Expand Down
3 changes: 3 additions & 0 deletions internal/storage/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,9 @@ func (svc *imageService) copyImage(systemContext *types.SystemContext, imageName
}
if err := json.NewEncoder(stdin).Encode(&stdinArguments); err != nil {
stdin.Close()
if waitErr := cmd.Wait(); waitErr != nil {
return errors.Wrap(err, waitErr.Error())
}
return errors.Wrap(err, "json encode to pipe failed")
}
stdin.Close()
Expand Down