mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-28 03:42:09 +00:00
runtime: bind-mount mounted block device into container
When the mounted block device isn't a layer, we want to mount it into containers, but since it's already mounted with the correct fs (e.g., tar, ext4, etc.) in the pod, we just bind-mount it into the container. Fixes: #7536 Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com>
This commit is contained in:
parent
7e1b1949d4
commit
4fbe0a3a53
@ -1662,6 +1662,10 @@ func (k *kataAgent) handleBlkOCIMounts(c *Container, spec *specs.Spec) ([]*grpc.
|
||||
"new-source": path,
|
||||
}).Debug("Replacing OCI mount source")
|
||||
spec.Mounts[idx].Source = path
|
||||
if HasOption(spec.Mounts[idx].Options, vcAnnotations.IsFileBlockDevice) {
|
||||
// The device is already mounted, just bind to path in container.
|
||||
spec.Mounts[idx].Options = []string{"bind"}
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user