shifting: raise an error if the container needs shifting
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
06cea37b86
commit
3f55e5a3ac
|
|
@ -4,6 +4,7 @@ import (
|
|||
"bytes"
|
||||
"compress/gzip"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
|
@ -651,6 +652,12 @@ func (r *layerStore) Mount(id, mountLabel string, uidMaps, gidMaps []idtools.IDM
|
|||
if mountLabel == "" {
|
||||
mountLabel = layer.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 != "" {
|
||||
|
|
|
|||
Loading…
Reference in New Issue