From 3ba8f2728139ada26adbddf28b086cf1a550099f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9na=C3=AFc=20Huard?= Date: Mon, 27 Jan 2025 14:18:05 +0100 Subject: [PATCH] Fix compilation warnings and errors --- CHANGELOG.md | 2 ++ examples/lading-container.yaml | 10 +++++----- lading/src/bin/payloadtool.rs | 1 + lading/src/generator/container.rs | 3 +-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84fa8f2a9..9512d21b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Added - Introduced the ability for users to configure lading's sample rate, configuration option `sample_period_milliseconds` in `lading.yaml`. +- Introduce a `container` generator able to generate an arbitrary number + of docker containers ## [0.25.4] ## Changed diff --git a/examples/lading-container.yaml b/examples/lading-container.yaml index cb06f9613..4fafbec7e 100644 --- a/examples/lading-container.yaml +++ b/examples/lading-container.yaml @@ -1,9 +1,9 @@ generator: - container: - repository: ghcr.io/scottopell/randomreader + repository: busybox tag: latest - args: [ "--buffer-size-mb", "10" ] + args: + - sleep + - infinity -blackhole: - - http: - binding_addr: "0.0.0.0:8080" +blackhole: [] diff --git a/lading/src/bin/payloadtool.rs b/lading/src/bin/payloadtool.rs index d9956c92a..019ea2735 100644 --- a/lading/src/bin/payloadtool.rs +++ b/lading/src/bin/payloadtool.rs @@ -131,6 +131,7 @@ fn check_generator(config: &lading::generator::Config) -> Result<(), Error> { } lading::generator::Inner::ProcessTree(_) => unimplemented!("ProcessTree not supported"), lading::generator::Inner::ProcFs(_) => unimplemented!("ProcFs not supported"), + lading::generator::Inner::Container(_) => unimplemented!("Container not supported"), }; Ok(()) diff --git a/lading/src/generator/container.rs b/lading/src/generator/container.rs index c9bb617d9..d298cae4e 100644 --- a/lading/src/generator/container.rs +++ b/lading/src/generator/container.rs @@ -16,7 +16,6 @@ use bollard::image::CreateImageOptions; use bollard::secret::ContainerCreateResponse; use bollard::Docker; use serde::{Deserialize, Serialize}; -use tokio::pin; use tokio_stream::StreamExt; use tracing::{info, warn}; use uuid::Uuid; @@ -65,7 +64,7 @@ impl Container { /// Will return an error if config parsing fails or runtime setup fails /// in the future. For now, always succeeds. pub fn new( - general: General, + _general: General, config: &Config, shutdown: lading_signal::Watcher, ) -> Result {