2024-06-02 04:58:01 +02:00
|
|
|
// SPDX-FileCopyrightText: © Matteo Settenvini <matteo.settenvini@montecristosoftware.eu>
|
|
|
|
// SPDX-License-Identifier: EUPL-1.2
|
|
|
|
|
2024-09-28 03:08:08 +02:00
|
|
|
use {
|
|
|
|
delegate::delegate,
|
|
|
|
std::borrow::Cow,
|
|
|
|
testcontainers::{
|
|
|
|
core::{ContainerPort, WaitFor},
|
|
|
|
Image,
|
|
|
|
},
|
|
|
|
testcontainers_modules::minio,
|
|
|
|
};
|
|
|
|
|
|
|
|
const MINIO_IMAGE_TAG: &'static str = "RELEASE.2024-09-22T00-33-43Z";
|
2024-06-02 04:58:01 +02:00
|
|
|
|
|
|
|
pub struct MinIO {
|
|
|
|
inner: minio::MinIO,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Image for MinIO {
|
2024-09-28 03:08:08 +02:00
|
|
|
fn tag(&self) -> &str {
|
|
|
|
MINIO_IMAGE_TAG.into()
|
2024-06-02 04:58:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
fn ready_conditions(&self) -> Vec<WaitFor> {
|
|
|
|
vec![WaitFor::message_on_stderr("API:")]
|
|
|
|
}
|
|
|
|
|
2024-09-28 03:08:08 +02:00
|
|
|
delegate! {
|
|
|
|
to self.inner {
|
|
|
|
fn name(&self) -> &str;
|
|
|
|
fn expose_ports(&self) -> &[ContainerPort];
|
|
|
|
fn env_vars(
|
|
|
|
&self,
|
|
|
|
) -> impl IntoIterator<Item = (impl Into<Cow<'_, str>>, impl Into<Cow<'_, str>>)>;
|
|
|
|
fn mounts(&self) -> impl IntoIterator<Item = &testcontainers::core::Mount>;
|
|
|
|
fn copy_to_sources(&self) -> impl IntoIterator<Item = &testcontainers::CopyToContainer>;
|
|
|
|
fn entrypoint(&self) -> Option<&str>;
|
|
|
|
fn cmd(&self) -> impl IntoIterator<Item = impl Into<std::borrow::Cow<'_, str>>>;
|
|
|
|
fn exec_after_start(
|
|
|
|
&self,
|
|
|
|
cs: testcontainers::core::ContainerState,
|
|
|
|
) -> Result<Vec<testcontainers::core::ExecCommand>, testcontainers::TestcontainersError>;
|
|
|
|
}
|
2024-06-02 04:58:01 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Default for MinIO {
|
|
|
|
fn default() -> Self {
|
|
|
|
Self {
|
|
|
|
inner: Default::default(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|