mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-30 23:37:45 +00:00
runtime-rs: Import the public const value from libs
Introduce a const value `KATA_VIRTUAL_VOLUME_PREFIX` defined in the libs/kata-types, and it'll be better import such const value from there. Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
This commit is contained in:
parent
8d86bcea4b
commit
7a59d7f937
@ -47,6 +47,9 @@ pub const SANDBOX_BIND_MOUNTS_RO: &str = ":ro";
|
||||
/// SANDBOX_BIND_MOUNTS_RO is for sandbox bindmounts with readwrite
|
||||
pub const SANDBOX_BIND_MOUNTS_RW: &str = ":rw";
|
||||
|
||||
/// KATA_VIRTUAL_VOLUME_PREFIX is for container image guest pull
|
||||
pub const KATA_VIRTUAL_VOLUME_PREFIX: &str = "io.katacontainers.volume=";
|
||||
|
||||
/// Directly assign a block volume to vm and mount it inside guest.
|
||||
pub const KATA_VIRTUAL_VOLUME_DIRECT_BLOCK: &str = "direct_block";
|
||||
/// Present a container image as a generic block device.
|
||||
@ -532,7 +535,7 @@ pub fn adjust_rootfs_mounts() -> Result<Vec<Mount>> {
|
||||
// Create a new Vec<Mount> with a single Mount entry.
|
||||
// This Mount's options will contain the base64-encoded virtual volume.
|
||||
Ok(vec![Mount {
|
||||
options: vec![format!("{}={}", "io.katacontainers.volume", b64_vol)],
|
||||
options: vec![format!("{}{}", KATA_VIRTUAL_VOLUME_PREFIX, b64_vol)],
|
||||
..Default::default() // Use default values for other Mount fields
|
||||
}])
|
||||
}
|
||||
|
@ -17,13 +17,12 @@ use hypervisor::device::device_manager::DeviceManager;
|
||||
use kata_types::{
|
||||
annotations,
|
||||
container::ContainerType,
|
||||
mount::{KataVirtualVolume, KATA_VIRTUAL_VOLUME_IMAGE_GUEST_PULL},
|
||||
mount::{KataVirtualVolume, KATA_VIRTUAL_VOLUME_IMAGE_GUEST_PULL, KATA_VIRTUAL_VOLUME_PREFIX},
|
||||
};
|
||||
|
||||
/// Image guest-pull related consts
|
||||
const KUBERNETES_CRI_IMAGE_NAME: &str = "io.kubernetes.cri.image-name";
|
||||
const KUBERNETES_CRIO_IMAGE_NAME: &str = "io.kubernetes.cri-o.ImageName";
|
||||
const KATA_VIRTUAL_VOLUME_PREFIX: &str = "io.katacontainers.volume=";
|
||||
const KATA_VIRTUAL_VOLUME_TYPE_OVERLAY_FS: &str = "overlayfs";
|
||||
const KATA_GUEST_ROOT_SHARED_FS: &str = "/run/kata-containers/";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user