MCPcopy Create free account
hub / github.com/bootc-dev/bootc / check_buildah_injected

Function check_buildah_injected

crates/lib/src/lints.rs:433–445  ·  view source on GitHub ↗
(root: &Dir, _config: &LintExecutionConfig)

Source from the content-addressed store, hash-verified

431// because we do expect /etc/hostname to be injected as
432.set_root_type(RootType::Alternative);
433fn check_buildah_injected(root: &Dir, _config: &LintExecutionConfig) -> LintResult {
434 const RUNTIME_INJECTED: &[&str] = &["etc/hostname", "etc/resolv.conf"];
435 for ent in RUNTIME_INJECTED {
436 if let Some(meta) = root.symlink_metadata_optional(ent)? {
437 if meta.is_file() && meta.size() == 0 {
438 return lint_err(format!(
439 "/{ent} is an empty file; this may have been synthesized by a container runtime."
440 ));
441 }
442 }
443 }
444 lint_ok()
445}
446
447#[distributed_slice(LINTS)]
448static LINT_ETC_USRUSETC: Lint = Lint::new_fatal(

Callers

nothing calls this directly

Calls 2

lint_errFunction · 0.85
lint_okFunction · 0.85

Tested by

no test coverage detected