Merge pull request #21295 from sm453/add-makecontainer-error-check

Add missing check for errors returned from SpecGenToOCI to MakeContainer
This commit is contained in:
openshift-merge-bot[bot] 2024-01-18 18:53:31 +00:00 committed by GitHub
commit 75c60d6139
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -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")