Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

podman mount: ignore ErrLayerUnknown #24091

Merged
merged 2 commits into from
Sep 30, 2024
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
4 changes: 2 additions & 2 deletions libpod/runtime_ctr.go
Original file line number Diff line number Diff line change
Expand Up @@ -1412,13 +1412,13 @@ func (r *Runtime) IsStorageContainerMounted(id string) (bool, string, error) {

mountCnt, err := r.storageService.MountedContainerImage(id)
if err != nil {
return false, "", err
return false, "", fmt.Errorf("get mount count of container: %w", err)
}
mounted := mountCnt > 0
if mounted {
path, err = r.storageService.GetMountpoint(id)
if err != nil {
return false, "", err
return false, "", fmt.Errorf("get container mount point: %w", err)
}
}
return mounted, path, nil
Expand Down
6 changes: 3 additions & 3 deletions pkg/domain/infra/abi/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -1418,10 +1418,10 @@ func (ic *ContainerEngine) ContainerMount(ctx context.Context, nameOrIDs []strin
// 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) {
if errors.Is(err, types.ErrContainerUnknown) || errors.Is(err, types.ErrLayerUnknown) || errors.Is(err, define.ErrCtrExists) {
continue
}
return nil, err
return nil, fmt.Errorf("check if storage container is mounted: %w", err)
}

var name string
Expand Down Expand Up @@ -1449,7 +1449,7 @@ func (ic *ContainerEngine) ContainerMount(ctx context.Context, nameOrIDs []strin
errors.Is(err, define.ErrCtrRemoved) {
continue
}
return nil, err
return nil, fmt.Errorf("check if container is mounted: %w", err)
}

if mounted {
Expand Down