Skip to content

Commit

Permalink
image-rs: change default workdir from /var/lib to /run
Browse files Browse the repository at this point in the history
/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 <[email protected]>
  • Loading branch information
Xynnn007 committed Sep 5, 2024
1 parent d86658c commit 493c703
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions image-rs/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 493c703

Please sign in to comment.