From 75eb4a31b860e36c7b62e1dd597c1015f427fc7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Milenkovi=C4=87?= Date: Wed, 15 Nov 2023 09:43:10 +0000 Subject: [PATCH] Expose ADMIN PORT --- src/lib.rs | 9 ++++++--- tests/redpanda.rs | 1 - 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index c744598..922cc63 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,10 +4,12 @@ use testcontainers::{ core::{ContainerState, ExecCommand, WaitFor}, Image, ImageArgs, RunnableImage, }; -/// Redpanda port +/// Redpanda/Kafka API port pub const REDPANDA_PORT: u16 = 9092; -/// Schema registry port +/// Schema Registry Port pub const SCHEMA_REGISTRY_PORT: u16 = 8081; +/// Prometheus and HTTP admin port +pub const ADMIN_PORT: u16 = 9644; #[derive(Debug)] pub struct Redpanda { @@ -20,6 +22,7 @@ impl Redpanda { RunnableImage::from(Self { tag }) .with_mapped_port((REDPANDA_PORT, REDPANDA_PORT)) .with_mapped_port((SCHEMA_REGISTRY_PORT, SCHEMA_REGISTRY_PORT)) + .with_mapped_port((ADMIN_PORT, ADMIN_PORT)) } #[deprecated = "Use Self::latest()"] @@ -103,7 +106,7 @@ impl Image for Redpanda { } fn expose_ports(&self) -> Vec { - vec![REDPANDA_PORT, SCHEMA_REGISTRY_PORT] + vec![REDPANDA_PORT, SCHEMA_REGISTRY_PORT, ADMIN_PORT] } fn exec_after_start(&self, cs: ContainerState) -> Vec { diff --git a/tests/redpanda.rs b/tests/redpanda.rs index c9ae65d..a6e7e48 100644 --- a/tests/redpanda.rs +++ b/tests/redpanda.rs @@ -1,7 +1,6 @@ mod common; #[cfg(test)] mod test { - use crate::common::*; use log::info; use testcontainers::clients;