Skip to content

Commit

Permalink
Expose ADMIN PORT
Browse files Browse the repository at this point in the history
  • Loading branch information
milenkovicm committed Nov 15, 2023
1 parent eb6a418 commit 75eb4a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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()"]
Expand Down Expand Up @@ -103,7 +106,7 @@ impl Image for Redpanda {
}

fn expose_ports(&self) -> Vec<u16> {
vec![REDPANDA_PORT, SCHEMA_REGISTRY_PORT]
vec![REDPANDA_PORT, SCHEMA_REGISTRY_PORT, ADMIN_PORT]
}

fn exec_after_start(&self, cs: ContainerState) -> Vec<ExecCommand> {
Expand Down
1 change: 0 additions & 1 deletion tests/redpanda.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
mod common;
#[cfg(test)]
mod test {

use crate::common::*;
use log::info;
use testcontainers::clients;
Expand Down

0 comments on commit 75eb4a3

Please sign in to comment.