runtime: update container creation to work with direct assigned volumes

During the container creation, it will parse the mount info file
of the direct assigned volumes and update the in memory mount object.

Fixes: #3454

Signed-off-by: Feng Wang <feng.wang@databricks.com>
This commit is contained in:
Feng Wang
2022-01-14 13:21:41 -08:00
parent 4e00c2377c
commit c39281ad65
4 changed files with 106 additions and 70 deletions

View File

@@ -172,7 +172,7 @@ func getDeviceForPath(path string) (device, error) {
}, nil
}
// We get the mount point by recursively peforming stat on the path
// We get the mount point by recursively performing stat on the path
// The point where the device changes indicates the mountpoint
for {
if mountPoint == "/" {
@@ -326,7 +326,9 @@ func bindMountContainerRootfs(ctx context.Context, shareDir, cid, cRootFs string
// Mount describes a container mount.
type Mount struct {
Source string
// Source is the source of the mount.
Source string
// Destination is the destination of the mount (within the container).
Destination string
// Type specifies the type of filesystem to mount.
@@ -335,6 +337,11 @@ type Mount struct {
// HostPath used to store host side bind mount path
HostPath string
// GuestDeviceMount represents the path within the VM that the device
// is mounted. Only relevant for block devices. This is tracked in the event
// runtime wants to query the agent for mount stats.
GuestDeviceMount string
// BlockDeviceID represents block device that is attached to the
// VM in case this mount is a block device file or a directory
// backed by a block device.