diff --git a/initramfs/src/httpclient.rs b/initramfs/src/httpclient.rs index c979384..dac59c9 100644 --- a/initramfs/src/httpclient.rs +++ b/initramfs/src/httpclient.rs @@ -1,6 +1,7 @@ use anyhow::{anyhow, Result}; use reqwest::{Client, Response}; +/// Wrapper around reqwest to run a GET request with bearer auth pub async fn run_get_request(url: &str, token: Option<&str>) -> Result { let res = match token { Some(token) => Client::new().get(url).bearer_auth(token), diff --git a/initramfs/src/image.rs b/initramfs/src/image.rs index 37ab4de..bceea14 100644 --- a/initramfs/src/image.rs +++ b/initramfs/src/image.rs @@ -40,6 +40,7 @@ pub struct Layer { pub content: Cursor, } +/// Represents a container image pub struct Image { name: String, tag: String, diff --git a/initramfs/src/main.rs b/initramfs/src/main.rs index ff56603..2c4c90c 100644 --- a/initramfs/src/main.rs +++ b/initramfs/src/main.rs @@ -1,3 +1,14 @@ +//! This is a tool to transform a container image into an initramfs image. +//! It will download the image from a container registry, extract it and +//! write it to disk. +//! The initramfs image will contain the init binary/script and the agent +//! binary as well as the agent configuration file. +//! The init binary will be the entrypoint of the initramfs image and will +//! start the agent binary. +//! +//! This image can then be used as an initramfs image for a linux kernel +//! in the lambdo runtime. + use std::fs::File; use anyhow::anyhow; diff --git a/initramfs/src/registry.rs b/initramfs/src/registry.rs index 81818b3..01d15db 100644 --- a/initramfs/src/registry.rs +++ b/initramfs/src/registry.rs @@ -20,6 +20,7 @@ struct ManifestResponse { fsLayers: Vec, } +/// A container registry (e.g. docker hub) pub struct Registry { url: String, auth_url: String,