mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-07-02 07:02:16 +00:00
runtime-rs: agent: add shared field to Storage struct
The proto Storage message already has a "shared" field (field 8), but the runtime-rs agent crate's internal Storage struct was missing it, so it was never forwarded to the kata-agent. Add the field to the Rust struct and its From<Storage> translation, and update all explicit struct initialisers across the resource crate to include shared: false so the build stays clean. This is needed for trusted ephemeral data storage, where the agent uses the shared flag to avoid premature cleanup of volumes that are shared across containers in a pod. Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com> Assisted-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -114,6 +114,7 @@ impl From<Storage> for agent::Storage {
|
||||
fs_group: from_option(from.fs_group),
|
||||
options: trans_vec(from.options),
|
||||
mount_point: from.mount_point,
|
||||
shared: from.shared,
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ pub struct Storage {
|
||||
pub fs_group: Option<FSGroup>,
|
||||
pub options: Vec<String>,
|
||||
pub mount_point: String,
|
||||
pub shared: bool,
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Clone, Default)]
|
||||
|
||||
@@ -89,6 +89,7 @@ impl ShareFs for ShareVirtioFsInline {
|
||||
fs_group: None,
|
||||
options: SHARED_DIR_VIRTIO_FS_OPTIONS.clone(),
|
||||
mount_point: kata_guest_share_dir(),
|
||||
shared: false,
|
||||
};
|
||||
|
||||
storages.push(shared_volume);
|
||||
|
||||
@@ -246,6 +246,7 @@ impl ShareFs for ShareVirtioFsStandalone {
|
||||
fs_group: None,
|
||||
options: vec![String::from("nodev")],
|
||||
mount_point: kata_guest_share_dir(),
|
||||
shared: false,
|
||||
};
|
||||
|
||||
storages.push(shared_volume);
|
||||
|
||||
@@ -108,6 +108,7 @@ impl ShareFsMount for VirtiofsShareMount {
|
||||
fs_group: None,
|
||||
options: config.mount_options.clone(),
|
||||
mount_point: watchable_guest_mount.clone(),
|
||||
shared: false,
|
||||
};
|
||||
|
||||
// Update the guest_path, in order to identify what will
|
||||
|
||||
@@ -67,6 +67,7 @@ impl EphemeralVolume {
|
||||
fs_group: None,
|
||||
options: dir_options,
|
||||
mount_point: source.clone(),
|
||||
shared: false,
|
||||
};
|
||||
|
||||
let mut mount = oci::Mount::default();
|
||||
|
||||
@@ -75,6 +75,7 @@ impl LocalStorage {
|
||||
fs_group: None,
|
||||
options: dir_options,
|
||||
mount_point: source.clone(),
|
||||
shared: false,
|
||||
};
|
||||
|
||||
let mounts: Vec<oci::Mount> = if sid != cid {
|
||||
|
||||
Reference in New Issue
Block a user