-
Notifications
You must be signed in to change notification settings - Fork 376
Conversation
amshinde
commented
Mar 25, 2019
We handle system directories differently, if its a bind mount we mount the guest system directory to the container mount and skip the 9p share mount. However, we should not do this for docker volumes which are directories created by Docker. This introduces a Docker specific check, but that is the only information available to us at the OCI layer. Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
k8s host empty-dir is equivalent to docker volumes. For this case, we should just use the host directory even for system directories. Move the isEphemeral function to virtcontainers to not introduce cyclic dependency. Fixes kata-containers#1417 Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
/retest |
fixes #1472 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @amshinde weekly ping update :)
@@ -326,3 +326,69 @@ func bindUnmountAllRootfs(ctx context.Context, sharedDir string, sandbox *Sandbo | |||
} | |||
} | |||
} | |||
|
|||
const ( | |||
dockerVolumePrefix = "/var/lib/docker/volumes" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great to check where is defined this is docker code just to add as a comment reference in case it changes in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var/lib/docker
is configurable at docker startup I may check only from volumes
func isEmptyDir(path string) bool { | ||
splitSourceSlice := strings.Split(path, "/") | ||
if len(splitSourceSlice) > 1 { | ||
storageType := splitSourceSlice[len(splitSourceSlice)-2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
magic number
@@ -282,3 +289,46 @@ func TestIsDeviceMapper(t *testing.T) { | |||
t.Fatal() | |||
} | |||
} | |||
|
|||
func TestIsDockerVolume(t *testing.T) { | |||
path := "/var/lib/docker/volumes/00da1347c7cf4f15db35f/_data" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dockerVolumePrefix