Skip to content

Commit 46e8f6c

Browse files
authored
Merge pull request #202 from miabbott/containerenv
containerenv: small error message fix
2 parents 48325ba + 641bb5a commit 46e8f6c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/src/containerenv.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use cap_std_ext::cap_std::fs::Dir;
77
use cap_std_ext::prelude::CapStdExtDirExt;
88
use fn_error_context::context;
99

10+
/// Path is relative to container rootfs (assumed to be /)
1011
const PATH: &str = "run/.containerenv";
1112

1213
#[derive(Debug, Default)]
@@ -25,7 +26,9 @@ pub(crate) fn get_container_execution_info(rootfs: &Dir) -> Result<ContainerExec
2526
let f = match rootfs.open_optional(PATH)? {
2627
Some(f) => BufReader::new(f),
2728
None => {
28-
anyhow::bail!("This command must be executed inside a podman container (missing {PATH}")
29+
anyhow::bail!(
30+
"This command must be executed inside a podman container (missing /{PATH})"
31+
)
2932
}
3033
};
3134
let mut r = ContainerExecutionInfo::default();

0 commit comments

Comments
 (0)