mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-10-28 00:37:39 +00:00
Merge pull request #23645 from Luap99/mount-race
podman mount: fix storage/libpod ctr race
This commit is contained in:
commit
e8410b8395
1 changed files with 5 additions and 1 deletions
|
|
@ -1392,7 +1392,11 @@ func (ic *ContainerEngine) ContainerMount(ctx context.Context, nameOrIDs []strin
|
|||
for _, sctr := range storageCtrs {
|
||||
mounted, path, err := ic.Libpod.IsStorageContainerMounted(sctr.ID)
|
||||
if err != nil {
|
||||
if errors.Is(err, types.ErrContainerUnknown) {
|
||||
// ErrCtrExists means this is a libpod container, we handle that below.
|
||||
// This can only happen in a narrow race because we first create the storage
|
||||
// container and then the libpod container so the StorageContainers() call
|
||||
// above would need to happen in that interval.
|
||||
if errors.Is(err, types.ErrContainerUnknown) || errors.Is(err, define.ErrCtrExists) {
|
||||
continue
|
||||
}
|
||||
return nil, err
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue