Compare commits
1 Commits
master
...
6a0406fa00
Author | SHA1 | Date | |
---|---|---|---|
6a0406fa00 |
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: {}
|
|
80
Cargo.lock
generated
80
Cargo.lock
generated
@@ -1024,17 +1024,6 @@ dependencies = [
|
|||||||
"hashbrown",
|
"hashbrown",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "io-uring"
|
|
||||||
version = "0.7.8"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "b86e202f00093dcba4275d4636b93ef9dd75d025ae560d2521b45ea28ab49013"
|
|
||||||
dependencies = [
|
|
||||||
"bitflags",
|
|
||||||
"cfg-if",
|
|
||||||
"libc",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ipnet"
|
name = "ipnet"
|
||||||
version = "2.11.0"
|
version = "2.11.0"
|
||||||
@@ -1206,7 +1195,7 @@ dependencies = [
|
|||||||
"http",
|
"http",
|
||||||
"json-patch",
|
"json-patch",
|
||||||
"k8s-openapi",
|
"k8s-openapi",
|
||||||
"schemars 0.8.22",
|
"schemars",
|
||||||
"serde",
|
"serde",
|
||||||
"serde-value",
|
"serde-value",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
@@ -1313,7 +1302,7 @@ dependencies = [
|
|||||||
"mktemp",
|
"mktemp",
|
||||||
"rand",
|
"rand",
|
||||||
"reqwest",
|
"reqwest",
|
||||||
"schemars 1.0.4",
|
"schemars",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"thiserror 2.0.12",
|
"thiserror 2.0.12",
|
||||||
@@ -1636,9 +1625,9 @@ checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rand"
|
name = "rand"
|
||||||
version = "0.9.2"
|
version = "0.9.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
|
checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"rand_chacha",
|
"rand_chacha",
|
||||||
"rand_core",
|
"rand_core",
|
||||||
@@ -1672,26 +1661,6 @@ dependencies = [
|
|||||||
"bitflags",
|
"bitflags",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ref-cast"
|
|
||||||
version = "1.0.24"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf"
|
|
||||||
dependencies = [
|
|
||||||
"ref-cast-impl",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ref-cast-impl"
|
|
||||||
version = "1.0.24"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex"
|
name = "regex"
|
||||||
version = "1.11.1"
|
version = "1.11.1"
|
||||||
@@ -1723,9 +1692,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "reqwest"
|
name = "reqwest"
|
||||||
version = "0.12.22"
|
version = "0.12.21"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cbc931937e6ca3a06e3b6c0aa7841849b160a90351d6ab467a8b9b9959767531"
|
checksum = "4c8cea6b35bcceb099f30173754403d2eba0a5dc18cea3630fccd88251909288"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64",
|
||||||
"bytes",
|
"bytes",
|
||||||
@@ -1891,20 +1860,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615"
|
checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dyn-clone",
|
"dyn-clone",
|
||||||
"schemars_derive 0.8.22",
|
"schemars_derive",
|
||||||
"serde",
|
|
||||||
"serde_json",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "schemars"
|
|
||||||
version = "1.0.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0"
|
|
||||||
dependencies = [
|
|
||||||
"dyn-clone",
|
|
||||||
"ref-cast",
|
|
||||||
"schemars_derive 1.0.4",
|
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
]
|
]
|
||||||
@@ -1921,18 +1877,6 @@ dependencies = [
|
|||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "schemars_derive"
|
|
||||||
version = "1.0.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "33d020396d1d138dc19f1165df7545479dcd58d93810dc5d646a16e55abefa80"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"serde_derive_internals",
|
|
||||||
"syn",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "scopeguard"
|
name = "scopeguard"
|
||||||
version = "1.2.0"
|
version = "1.2.0"
|
||||||
@@ -2027,9 +1971,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_json"
|
name = "serde_json"
|
||||||
version = "1.0.141"
|
version = "1.0.140"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "30b9eff21ebe718216c6ec64e1d9ac57087aad11efc64e32002bce4a0d4c03d3"
|
checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itoa",
|
"itoa",
|
||||||
"memchr",
|
"memchr",
|
||||||
@@ -2259,19 +2203,17 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tokio"
|
name = "tokio"
|
||||||
version = "1.46.1"
|
version = "1.45.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17"
|
checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"backtrace",
|
"backtrace",
|
||||||
"bytes",
|
"bytes",
|
||||||
"io-uring",
|
|
||||||
"libc",
|
"libc",
|
||||||
"mio",
|
"mio",
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"signal-hook-registry",
|
"signal-hook-registry",
|
||||||
"slab",
|
|
||||||
"socket2",
|
"socket2",
|
||||||
"tokio-macros",
|
"tokio-macros",
|
||||||
"windows-sys 0.52.0",
|
"windows-sys 0.52.0",
|
||||||
|
10
Cargo.toml
10
Cargo.toml
@@ -10,13 +10,13 @@ log = "0.4.27"
|
|||||||
env_logger = "0.11.8"
|
env_logger = "0.11.8"
|
||||||
anyhow = "1.0.98"
|
anyhow = "1.0.98"
|
||||||
serde = { version = "1.0.219", features = ["derive"] }
|
serde = { version = "1.0.219", features = ["derive"] }
|
||||||
serde_json = "1.0.141"
|
serde_json = "1.0.140"
|
||||||
schemars = "1.0.4"
|
schemars = "0.8.22"
|
||||||
tokio = { version = "1.46.1", features = ["full"] }
|
tokio = { version = "1.45.1", features = ["full"] }
|
||||||
kube = { version = "1.1.0", features = ["runtime", "derive"] }
|
kube = { version = "1.1.0", features = ["runtime", "derive"] }
|
||||||
k8s-openapi = { version = "0.25.0", features = ["v1_31"] }
|
k8s-openapi = { version = "0.25.0", features = ["v1_31"] }
|
||||||
futures = "0.3.31"
|
futures = "0.3.31"
|
||||||
thiserror = "2.0.12"
|
thiserror = "2.0.12"
|
||||||
rand = "0.9.2"
|
rand = "0.9.1"
|
||||||
mktemp = "0.5.1"
|
mktemp = "0.5.1"
|
||||||
reqwest = "0.12.22"
|
reqwest = "0.12.21"
|
||||||
|
@@ -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