Trivy: scan images from the local containerd store before the registry
Some checks failed
CI / backend (push) Has been cancelled
CI / frontend (push) Has been cancelled
CI / ui (push) Has been cancelled

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Dennis Nemec
2026-09-02 23:18:05 +02:00
parent 6134a47ff2
commit a89395ae18
4 changed files with 103 additions and 3 deletions

View File

@ -13,6 +13,8 @@ pub struct Config {
pub kubeconfig: Option<String>,
/// kubectl invocation for backups, e.g. ["/snap/bin/microk8s", "kubectl"].
pub kubectl: Vec<String>,
/// containerd socket for local image scans (default: microk8s socket if present).
pub containerd_socket: Option<String>,
/// Scratch directory for backup archives.
pub work_dir: std::path::PathBuf,
pub bind: SocketAddr,
@ -47,6 +49,12 @@ impl Config {
vec!["kubectl".into()]
}
}),
containerd_socket: env("CONTAINERD_ADDRESS").or_else(|| {
let microk8s = "/var/snap/microk8s/common/run/containerd.sock";
std::path::Path::new(microk8s)
.exists()
.then(|| microk8s.to_string())
}),
work_dir: env("WORK_DIR")
.map(Into::into)
.unwrap_or_else(|| "data/work".into()),