From 493c703c763e75b1715fdc459d5c2b27f371643d Mon Sep 17 00:00:00 2001 From: Xynnn007 Date: Fri, 23 Aug 2024 11:27:15 +0800 Subject: [PATCH] image-rs: change default workdir from /var/lib to /run /run is a tmpfs workdir that would live inside guest memory for CoCo, while `/var/lib` is on disk. This would help CDH to avoid setting another default image workdir. As image-rs is able to set any workdir from its config, this patch will not influence the flexibility. Signed-off-by: Xynnn007 --- image-rs/src/config.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/image-rs/src/config.rs b/image-rs/src/config.rs index f4a608d66..c7eecacd3 100644 --- a/image-rs/src/config.rs +++ b/image-rs/src/config.rs @@ -9,7 +9,7 @@ use std::path::{Path, PathBuf}; use crate::snapshots::SnapshotType; -pub const DEFAULT_WORK_DIR: &str = "/var/lib/image-rs/"; +pub const DEFAULT_WORK_DIR: &str = "/run/image-rs/"; /// Default policy file path. pub const POLICY_FILE_PATH: &str = "kbs:///default/security-policy/test"; @@ -325,7 +325,7 @@ mod tests { #[test] fn test_image_config_from_file() { let data = r#"{ - "work_dir": "/var/lib/image-rs/", + "work_dir": "/run/image-rs/", "default_snapshot": "overlay", "security_validate": false, "auth": false, @@ -357,7 +357,7 @@ mod tests { #[test] fn test_nydus_config_from_file() { let data = r#"{ - "work_dir": "/var/lib/image-rs/", + "work_dir": "/run/image-rs/", "default_snapshot": "overlay", "security_validate": false, "auth": false,