From 088aaf1a32e1139dd65b8dccc47adb53f059dba3 Mon Sep 17 00:00:00 2001 From: Antonio Murdaca Date: Fri, 13 Oct 2017 10:30:29 +0200 Subject: [PATCH] CRI-O: fix handling of overlay2 storage Signed-off-by: Antonio Murdaca --- container/crio/handler.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/container/crio/handler.go b/container/crio/handler.go index 6e6fa58563..391d383322 100644 --- a/container/crio/handler.go +++ b/container/crio/handler.go @@ -18,6 +18,7 @@ package crio import ( "fmt" "path" + "path/filepath" "strconv" "strings" "time" @@ -142,6 +143,12 @@ func newCrioContainerHandler( // get device ID from root, otherwise, it's going to error out as overlay // mounts doesn't have fixed dev ids. 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 handler := &crioContainerHandler{