mirror of
https://codeberg.org/icewind/haze.git
synced 2026-06-03 17:14:08 +02:00
proper healthy check for s3
This commit is contained in:
parent
1a4fd72da2
commit
8c191859b2
2 changed files with 15 additions and 3 deletions
|
|
@ -1,3 +1,4 @@
|
|||
use crate::exec::exec;
|
||||
use crate::image::pull_image;
|
||||
use bollard::container::{Config, CreateContainerOptions, NetworkingConfig};
|
||||
use bollard::models::{EndpointSettings, HostConfig};
|
||||
|
|
@ -123,8 +124,19 @@ impl ObjectStore {
|
|||
Ok(id)
|
||||
}
|
||||
|
||||
async fn is_healthy(&self, _docker: &Docker, _cloud_id: &str) -> Result<bool> {
|
||||
Ok(true)
|
||||
async fn is_healthy(&self, docker: &Docker, cloud_id: &str) -> Result<bool> {
|
||||
let mut output = Vec::new();
|
||||
exec(
|
||||
docker,
|
||||
format!("{}-object", cloud_id),
|
||||
"root",
|
||||
vec!["curl", "localhost:4569/"],
|
||||
vec![],
|
||||
Some(&mut output),
|
||||
)
|
||||
.await?;
|
||||
let output = String::from_utf8(output)?;
|
||||
Ok(output.contains("ListAllMyBucketsResult"))
|
||||
}
|
||||
|
||||
fn container_name(&self, cloud_id: &str) -> String {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue