Skip to content

Commit

Permalink
Merge pull request #202 from miabbott/containerenv
Browse files Browse the repository at this point in the history
containerenv: small error message fix
  • Loading branch information
cgwalters committed Nov 11, 2023
2 parents 48325ba + 641bb5a commit 46e8f6c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/src/containerenv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use cap_std_ext::cap_std::fs::Dir;
use cap_std_ext::prelude::CapStdExtDirExt;
use fn_error_context::context;

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

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

0 comments on commit 46e8f6c

Please sign in to comment.