mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-12 14:48:13 +00:00
runtime-rs: Add attribute serde rename to each field of DirectVolume.
DirectVolume structure in runtime-rs is different from it in kata-runtime, which causes they has no unified handling method for DirectVolumeMountInfo and MountInfo. We should align the two by simply adding the attribute #[serde(rename="x") to each field in DirectVolumeMountInfo Fixes: #8619 Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
This commit is contained in:
parent
1c42d94550
commit
80d631ee84
@ -94,14 +94,18 @@ impl Mount {
|
|||||||
#[derive(Debug, Clone, Eq, PartialEq, Default, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Eq, PartialEq, Default, Serialize, Deserialize)]
|
||||||
pub struct DirectVolumeMountInfo {
|
pub struct DirectVolumeMountInfo {
|
||||||
/// The type of the volume (ie. block)
|
/// The type of the volume (ie. block)
|
||||||
|
#[serde(rename = "volume-type")]
|
||||||
pub volume_type: String,
|
pub volume_type: String,
|
||||||
/// The device backing the volume.
|
/// The device backing the volume.
|
||||||
pub device: String,
|
pub device: String,
|
||||||
/// The filesystem type to be mounted on the volume.
|
/// The filesystem type to be mounted on the volume.
|
||||||
|
#[serde(rename = "fstype")]
|
||||||
pub fs_type: String,
|
pub fs_type: String,
|
||||||
/// Additional metadata to pass to the agent regarding this volume.
|
/// Additional metadata to pass to the agent regarding this volume.
|
||||||
|
#[serde(default, skip_serializing_if = "HashMap::is_empty")]
|
||||||
pub metadata: HashMap<String, String>,
|
pub metadata: HashMap<String, String>,
|
||||||
/// Additional mount options.
|
/// Additional mount options.
|
||||||
|
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||||
pub options: Vec<String>,
|
pub options: Vec<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user