Merge pull request #1771 from runcom/fix-overlay2-crio

CRI-O: fix handling of overlay2 storage
This commit is contained in:
David Ashpole 2017-10-23 10:16:02 -07:00 committed by GitHub
commit 99716b05db

View File

@ -18,6 +18,7 @@ package crio
import ( import (
"fmt" "fmt"
"path" "path"
"path/filepath"
"strconv" "strconv"
"strings" "strings"
"time" "time"
@ -142,6 +143,12 @@ func newCrioContainerHandler(
// get device ID from root, otherwise, it's going to error out as overlay // get device ID from root, otherwise, it's going to error out as overlay
// mounts doesn't have fixed dev ids. // mounts doesn't have fixed dev ids.
rootfsStorageDir = strings.TrimSuffix(rootfsStorageDir, "/merged") rootfsStorageDir = strings.TrimSuffix(rootfsStorageDir, "/merged")
switch storageDriver {
case overlayStorageDriver, overlay2StorageDriver:
// overlay and overlay2 driver are the same "overlay2" driver so treat
// them the same.
rootfsStorageDir = filepath.Join(rootfsStorageDir, "diff")
}
// TODO: extract object mother method // TODO: extract object mother method
handler := &crioContainerHandler{ handler := &crioContainerHandler{