mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-11 22:28:06 +00:00
kata-agent: optional bind flag
Fixes: #9269 From https://github.com/opencontainers/runtime-spec/blob/main/config.md#mounts type (string, OPTIONAL) The type of the filesystem to be mounted. bind may be only specified in the oci spec options -> flags update r#type The agent will ignore bind mounts if they are only specified in the OCI spec options and not in the flags. Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
This commit is contained in:
parent
a116b252c8
commit
c15e19c806
@ -218,6 +218,17 @@ pub fn init_rootfs(
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// From https://github.com/opencontainers/runtime-spec/blob/main/config.md#mounts
|
||||||
|
// type (string, OPTIONAL) The type of the filesystem to be mounted.
|
||||||
|
// bind may be only specified in the oci spec options -> flags update r#type
|
||||||
|
let m = &{
|
||||||
|
let mut mbind = m.clone();
|
||||||
|
if mbind.r#type.is_empty() && flags & MsFlags::MS_BIND == MsFlags::MS_BIND {
|
||||||
|
mbind.r#type = "bind".to_string();
|
||||||
|
}
|
||||||
|
mbind
|
||||||
|
};
|
||||||
|
|
||||||
if m.r#type == "cgroup" {
|
if m.r#type == "cgroup" {
|
||||||
mount_cgroups(cfd_log, m, rootfs, flags, &data, cpath, mounts)?;
|
mount_cgroups(cfd_log, m, rootfs, flags, &data, cpath, mounts)?;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user