Compare commits
1 Commits
renovate/s
...
5be2712f11
Author | SHA1 | Date | |
---|---|---|---|
5be2712f11 |
34
.drone.yml
34
.drone.yml
@ -4,39 +4,17 @@ type: docker
|
|||||||
name: default
|
name: default
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: fetch_dependencies
|
- name: cargo_check
|
||||||
image: rust
|
image: rust
|
||||||
volumes:
|
|
||||||
- name: rust_registry
|
|
||||||
path: /usr/local/cargo/registry
|
|
||||||
commands:
|
|
||||||
- cargo fetch
|
|
||||||
|
|
||||||
- name: code_quality
|
|
||||||
image: rust
|
|
||||||
volumes:
|
|
||||||
- name: rust_registry
|
|
||||||
path: /usr/local/cargo/registry
|
|
||||||
depends_on:
|
|
||||||
- fetch_dependencies
|
|
||||||
commands:
|
|
||||||
- rustup component add clippy
|
|
||||||
- cargo clippy -- -D warnings
|
|
||||||
|
|
||||||
- name: test
|
|
||||||
image: rust
|
|
||||||
depends_on:
|
|
||||||
- code_quality
|
|
||||||
volumes:
|
|
||||||
- name: rust_registry
|
|
||||||
path: /usr/local/cargo/registry
|
|
||||||
commands:
|
commands:
|
||||||
- wget -O /usr/bin/minio https://dl.min.io/server/minio/release/linux-amd64/minio
|
- wget -O /usr/bin/minio https://dl.min.io/server/minio/release/linux-amd64/minio
|
||||||
- wget -O /usr/bin/mc https://dl.min.io/client/mc/release/linux-amd64/mc
|
- wget -O /usr/bin/mc https://dl.min.io/client/mc/release/linux-amd64/mc
|
||||||
- chmod +x /usr/bin/minio /usr/bin/mc
|
- chmod +x /usr/bin/minio /usr/bin/mc
|
||||||
|
- rustup component add clippy
|
||||||
|
- cargo clippy -- -D warnings
|
||||||
- cargo test
|
- cargo test
|
||||||
|
|
||||||
- name: build_doc
|
- name: doc
|
||||||
image: python
|
image: python
|
||||||
environment:
|
environment:
|
||||||
AWS_ACCESS_KEY_ID:
|
AWS_ACCESS_KEY_ID:
|
||||||
@ -61,7 +39,3 @@ steps:
|
|||||||
- aws configure set default.s3.signature_version s3v4
|
- aws configure set default.s3.signature_version s3v4
|
||||||
# Upload to bucket
|
# Upload to bucket
|
||||||
- cd public && aws --endpoint-url https://s3.communiquons.org s3 sync . s3://miniok8sbucketsoperator-website
|
- cd public && aws --endpoint-url https://s3.communiquons.org s3 sync . s3://miniok8sbucketsoperator-website
|
||||||
|
|
||||||
volumes:
|
|
||||||
- name: rust_registry
|
|
||||||
temp: {}
|
|
892
Cargo.lock
generated
892
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
18
Cargo.toml
18
Cargo.toml
@ -7,16 +7,16 @@ edition = "2021"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
log = "0.4.27"
|
log = "0.4.27"
|
||||||
env_logger = "0.11.8"
|
env_logger = "0.11.7"
|
||||||
anyhow = "1.0.98"
|
anyhow = "1.0.97"
|
||||||
serde = { version = "1.0.219", features = ["derive"] }
|
serde = { version = "1.0.218", features = ["derive"] }
|
||||||
serde_json = "1.0.140"
|
serde_json = "1.0.140"
|
||||||
schemars = "0.9.0"
|
schemars = "0.8.17"
|
||||||
tokio = { version = "1.45.1", features = ["full"] }
|
tokio = { version = "1.37.0", features = ["full"] }
|
||||||
kube = { version = "1.1.0", features = ["runtime", "derive"] }
|
kube = { version = "0.99.0", features = ["runtime", "derive"] }
|
||||||
k8s-openapi = { version = "0.25.0", features = ["v1_31"] }
|
k8s-openapi = { version = "0.24.0", features = ["v1_31"] }
|
||||||
futures = "0.3.31"
|
futures = "0.3.31"
|
||||||
thiserror = "2.0.12"
|
thiserror = "2.0.12"
|
||||||
rand = "0.9.1"
|
rand = "0.9.0"
|
||||||
mktemp = "0.5.1"
|
mktemp = "0.5.1"
|
||||||
reqwest = "0.12.20"
|
reqwest = "0.12.3"
|
||||||
|
@ -164,7 +164,7 @@ impl MinioService {
|
|||||||
|
|
||||||
/// Get bucket name prefixed by mc alias name
|
/// Get bucket name prefixed by mc alias name
|
||||||
fn absolute_bucket_name(&self, name: &str) -> String {
|
fn absolute_bucket_name(&self, name: &str) -> String {
|
||||||
format!("{MC_ALIAS_NAME}/{name}")
|
format!("{}/{name}", MC_ALIAS_NAME)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Execute a minio mc command
|
/// Execute a minio mc command
|
||||||
@ -172,7 +172,7 @@ impl MinioService {
|
|||||||
where
|
where
|
||||||
A: DeserializeOwned,
|
A: DeserializeOwned,
|
||||||
{
|
{
|
||||||
log::debug!("exec_mc_cmd with args {args:?}");
|
log::debug!("exec_mc_cmd with args {:?}", args);
|
||||||
|
|
||||||
let conf_dir = temp::create_temp_dir()?;
|
let conf_dir = temp::create_temp_dir()?;
|
||||||
let global_flags = ["--config-dir", conf_dir.to_str().unwrap(), "--json"];
|
let global_flags = ["--config-dir", conf_dir.to_str().unwrap(), "--json"];
|
||||||
@ -354,7 +354,7 @@ impl MinioService {
|
|||||||
let bucket_name = self.absolute_bucket_name(bucket);
|
let bucket_name = self.absolute_bucket_name(bucket);
|
||||||
|
|
||||||
let res = if let Some(quota) = "a {
|
let res = if let Some(quota) = "a {
|
||||||
let quota = format!("{quota}B");
|
let quota = format!("{}B", quota);
|
||||||
self.exec_mc_cmd::<BasicMinioResult>(&[
|
self.exec_mc_cmd::<BasicMinioResult>(&[
|
||||||
"quota",
|
"quota",
|
||||||
"set",
|
"set",
|
||||||
@ -447,7 +447,7 @@ impl MinioService {
|
|||||||
"governance" => RetentionType::Governance,
|
"governance" => RetentionType::Governance,
|
||||||
"compliance" => RetentionType::Compliance,
|
"compliance" => RetentionType::Compliance,
|
||||||
o => {
|
o => {
|
||||||
log::error!("Unknown retention type: {o}");
|
log::error!("Unknown retention type: {}", o);
|
||||||
return Ok(None);
|
return Ok(None);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user