Skip to content

Commit

Permalink
Merge pull request #21295 from sm453/add-makecontainer-error-check
Browse files Browse the repository at this point in the history
Add missing check for errors returned from SpecGenToOCI to MakeContainer
  • Loading branch information
openshift-merge-bot[bot] authored Jan 18, 2024
2 parents ce42c9f + 77389bd commit 75c60d6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/specgen/generate/container_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ func MakeContainer(ctx context.Context, rt *libpod.Runtime, s *specgen.SpecGener
options = append(options, opts...)
}
runtimeSpec, err := SpecGenToOCI(ctx, s, rt, rtc, newImage, finalMounts, pod, command, compatibleOptions)
if err != nil {
return nil, nil, nil, err
}
if clone { // the container fails to start if cloned due to missing Linux spec entries
if c == nil {
return nil, nil, nil, errors.New("the given container could not be retrieved")
Expand Down

0 comments on commit 75c60d6

Please sign in to comment.