mirror of
https://github.com/containers/podman.git
synced 2025-06-17 06:57:43 +08:00
vendor: update containers/storage
update to version 956a1971694f18fd602b1203c0a2d192e2cc88a1 inherit support for IDs shifting when fuse-overlayfs is used. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Closes: #1177 Approved by: mheon
This commit is contained in:

committed by
Atomic Bot

parent
5aa36c1861
commit
a4a667eac9
16
vendor/github.com/containers/storage/layers.go
generated
vendored
16
vendor/github.com/containers/storage/layers.go
generated
vendored
@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"compress/gzip"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
@ -208,7 +209,8 @@ type LayerStore interface {
|
||||
// Mount mounts a layer for use. If the specified layer is the parent of other
|
||||
// layers, it should not be written to. An SELinux label to be applied to the
|
||||
// mount can be specified to override the one configured for the layer.
|
||||
Mount(id, mountLabel string) (string, error)
|
||||
// The mappings used by the container can be specified.
|
||||
Mount(id, mountLabel string, uidMaps, gidMaps []idtools.IDMap) (string, error)
|
||||
|
||||
// Unmount unmounts a layer when it is no longer in use.
|
||||
Unmount(id string, force bool) (bool, error)
|
||||
@ -635,7 +637,7 @@ func (r *layerStore) Mounted(id string) (int, error) {
|
||||
return layer.MountCount, nil
|
||||
}
|
||||
|
||||
func (r *layerStore) Mount(id, mountLabel string) (string, error) {
|
||||
func (r *layerStore) Mount(id, mountLabel string, uidMaps, gidMaps []idtools.IDMap) (string, error) {
|
||||
if !r.IsReadWrite() {
|
||||
return "", errors.Wrapf(ErrStoreIsReadOnly, "not allowed to update mount locations for layers at %q", r.mountspath())
|
||||
}
|
||||
@ -650,7 +652,13 @@ func (r *layerStore) Mount(id, mountLabel string) (string, error) {
|
||||
if mountLabel == "" {
|
||||
mountLabel = layer.MountLabel
|
||||
}
|
||||
mountpoint, err := r.driver.Get(id, mountLabel)
|
||||
|
||||
if (uidMaps != nil || gidMaps != nil) && !r.driver.SupportsShifting() {
|
||||
if !reflect.DeepEqual(uidMaps, layer.UIDMap) || !reflect.DeepEqual(gidMaps, layer.GIDMap) {
|
||||
return "", fmt.Errorf("cannot mount layer %v: shifting not enabled", layer.ID)
|
||||
}
|
||||
}
|
||||
mountpoint, err := r.driver.Get(id, mountLabel, uidMaps, gidMaps)
|
||||
if mountpoint != "" && err == nil {
|
||||
if layer.MountPoint != "" {
|
||||
delete(r.bymount, layer.MountPoint)
|
||||
@ -937,7 +945,7 @@ func (r *layerStore) newFileGetter(id string) (drivers.FileGetCloser, error) {
|
||||
if getter, ok := r.driver.(drivers.DiffGetterDriver); ok {
|
||||
return getter.DiffGetter(id)
|
||||
}
|
||||
path, err := r.Mount(id, "")
|
||||
path, err := r.Mount(id, "", nil, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user