diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05f960e..dd3de76 100755 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,3 +110,6 @@ jobs: - name: Run clippy lints run: cargo clippy --all-features -- -D warnings + + - name: Check Rust-native e2e harness + run: make e2e-check diff --git a/.gitignore b/.gitignore index 0e4b0f5..a8cedbc 100755 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ /target +/e2e/target +.e2e-cache /vendor .idea .DS_Store diff --git a/Makefile b/Makefile index 70c72d6..5628d8a 100644 --- a/Makefile +++ b/Makefile @@ -12,9 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -.PHONY: pre-commit fmt fmt-check clippy test build docker-build-operator docker-build-console-web docker-build-all help console-lint console-fmt console-fmt-check +.PHONY: pre-commit fmt fmt-check clippy test build help +.PHONY: docker-build-operator docker-build-console-web docker-build-all +.PHONY: console-lint console-fmt console-fmt-check +.PHONY: e2e-check e2e-live-create e2e-live-run e2e-live-update e2e-live-delete + +# Default target +IMAGE_REPO ?= rustfs/operator +IMAGE_TAG ?= dev +CONSOLE_WEB_IMAGE_REPO ?= rustfs/console-web +CONSOLE_WEB_IMAGE_TAG ?= dev -# 默认目标 help: @echo "RustFS Operator Makefile" @echo "" @@ -31,10 +39,15 @@ help: @echo " make console-lint - 前端 ESLint 检查 (console-web)" @echo " make console-fmt - 前端 Prettier 自动格式化 (console-web)" @echo " make console-fmt-check - 前端 Prettier 格式检查 (console-web)" + @echo " make e2e-check - Check Rust-native e2e harness (fmt + test + clippy)" + @echo " make e2e-live-create - Clean dedicated storage, recreate live Kind environment and load e2e image" + @echo " make e2e-live-run - Run all live suites (smoke/operator/console) in the existing live environment" + @echo " make e2e-live-update - Rebuild image and update the live environment (load + rollout)" + @echo " make e2e-live-delete - Delete live Kind environment and clean dedicated storage" -# 提交前检查:Rust (fmt-check + clippy + test) + 前端 (lint + 格式检查) -pre-commit: fmt-check clippy test console-lint console-fmt-check - @echo "pre-commit: 所有检查通过" +# pre-commit checks: Rust main crate + e2e harness + frontend (lint + format checks) +pre-commit: fmt-check clippy test e2e-check console-lint console-fmt-check + @echo "pre-commit: all checks passed" # 自动格式化 fmt: @@ -68,14 +81,48 @@ console-fmt-check: build: cargo build --release +# Rust-native e2e harness (live-first, dedicated Kind) +E2E_MANIFEST ?= e2e/Cargo.toml +E2E_BIN ?= cargo run --manifest-path $(E2E_MANIFEST) --bin rustfs-e2e -- +E2E_TEST_THREADS ?= 1 + +# Rust-native e2e harness checks (non-live; ignored live tests remain opt-in) +e2e-check: + cargo fmt --manifest-path $(E2E_MANIFEST) --all --check + cargo test --manifest-path $(E2E_MANIFEST) + cargo clippy --manifest-path $(E2E_MANIFEST) --all-targets -- -D warnings + +# 4-command live workflow. Keep helper steps inline so the public Make surface stays small. +e2e-live-create: + docker build --network host -t rustfs/operator:e2e . + docker build --network host -t rustfs/console-web:e2e -f console-web/Dockerfile console-web + RUSTFS_E2E_LIVE=1 $(E2E_BIN) kind-delete || true + RUSTFS_E2E_LIVE=1 $(E2E_BIN) kind-create + RUSTFS_E2E_LIVE=1 $(E2E_BIN) kind-load-images + +e2e-live-run: + RUSTFS_E2E_LIVE=1 $(E2E_BIN) assert-context + RUSTFS_E2E_LIVE=1 $(E2E_BIN) deploy-dev + RUSTFS_E2E_LIVE=1 cargo test --manifest-path $(E2E_MANIFEST) --test smoke -- --ignored --test-threads=$(E2E_TEST_THREADS) --nocapture + RUSTFS_E2E_LIVE=1 cargo test --manifest-path $(E2E_MANIFEST) --test operator -- --ignored --test-threads=$(E2E_TEST_THREADS) --nocapture + RUSTFS_E2E_LIVE=1 cargo test --manifest-path $(E2E_MANIFEST) --test console -- --ignored --test-threads=$(E2E_TEST_THREADS) --nocapture + @echo "configured live e2e suites passed." + +e2e-live-update: + docker build --network host -t rustfs/operator:e2e . + docker build --network host -t rustfs/console-web:e2e -f console-web/Dockerfile console-web + RUSTFS_E2E_LIVE=1 $(E2E_BIN) assert-context + RUSTFS_E2E_LIVE=1 $(E2E_BIN) kind-load-images + RUSTFS_E2E_LIVE=1 $(E2E_BIN) rollout-dev + +e2e-live-delete: + RUSTFS_E2E_LIVE=1 $(E2E_BIN) kind-delete + + # 构建 Docker 镜像(operator:含 controller + console API;console-web:前端静态资源) -IMAGE_REPO ?= rustfs/operator -IMAGE_TAG ?= dev docker-build-operator: docker build -t $(IMAGE_REPO):$(IMAGE_TAG) . -CONSOLE_WEB_IMAGE_REPO ?= rustfs/console-web -CONSOLE_WEB_IMAGE_TAG ?= dev docker-build-console-web: docker build -t $(CONSOLE_WEB_IMAGE_REPO):$(CONSOLE_WEB_IMAGE_TAG) -f console-web/Dockerfile console-web diff --git a/e2e/Cargo.lock b/e2e/Cargo.lock new file mode 100644 index 0000000..c8017e1 --- /dev/null +++ b/e2e/Cargo.lock @@ -0,0 +1,3719 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "getrandom 0.3.4", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anstream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anstyle-parse" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.61.2", +] + +[[package]] +name = "anyhow" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" + +[[package]] +name = "arbitrary" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" +dependencies = [ + "derive_arbitrary", +] + +[[package]] +name = "async-broadcast" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" +dependencies = [ + "event-listener", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-compression" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e79b3f8a79cccc2898f31920fc69f304859b3bd567490f75ebf51ae1c792a9ac" +dependencies = [ + "compression-codecs", + "compression-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "async-stream" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "async-trait" +version = "0.1.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "axum" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" +dependencies = [ + "async-trait", + "axum-core", + "axum-macros", + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d123550fa8d071b7255cb0cc04dc302baa6c8c4a79f55701552684d8399bce" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "backon" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cffb0e931875b666fc4fcb20fee52e9bbd1ef836fd9e9e04ec21555f9f85f7ef" +dependencies = [ + "fastrand", + "gloo-timers", + "tokio", +] + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bitflags" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" + +[[package]] +name = "bytes" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" + +[[package]] +name = "cc" +version = "1.2.62" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1dce859f0832a7d088c4f1119888ab94ef4b5d6795d1ce05afb7fe159d79f98" +dependencies = [ + "find-msvc-tools", + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chrono" +version = "0.4.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-link", +] + +[[package]] +name = "clap" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" + +[[package]] +name = "colorchoice" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" + +[[package]] +name = "compression-codecs" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce2548391e9c1929c21bf6aa2680af86fe4c1b33e6cea9ac1cfeec0bd11218cf" +dependencies = [ + "compression-core", + "flate2", + "memchr", +] + +[[package]] +name = "compression-core" +version = "0.4.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc14f565cf027a105f7a44ccf9e5b424348421a1d8952a8fc9d499d313107789" + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "const-str" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18f12cc9948ed9604230cdddc7c86e270f9401ccbe3c2e98a4378c5e7632212f" + +[[package]] +name = "const_format" +version = "0.2.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4481a617ad9a412be3b97c5d403fef8ed023103368908b9c50af598ff467cc1e" +dependencies = [ + "const_format_proc_macros", + "konst", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "cookie" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" +dependencies = [ + "percent-encoding", + "time", + "version_check", +] + +[[package]] +name = "cookie_store" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15b2c103cf610ec6cae3da84a766285b42fd16aad564758459e6ecf128c75206" +dependencies = [ + "cookie", + "document-features", + "idna", + "log", + "publicsuffix", + "serde", + "serde_derive", + "serde_json", + "time", + "url", +] + +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "darling" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cdf337090841a411e2a7f3deb9187445851f91b309c0c0a29e05f74a00a48c0" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1247195ecd7e3c85f83c8d2a366e4210d588e802133e1e355180a9870b517ea4" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "deranged" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "derive_arbitrary" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "derive_more" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "syn", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "document-features" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61" +dependencies = [ + "litrs", +] + +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "enum-ordinalize" +version = "4.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a1091a7bb1f8f2c4b28f1fe2cef4980ca2d410a3d727d67ecc3178c9b0800f0" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ca9601fb2d62598ee17836250842873a413586e5d7ed88b356e38ddbb0ec631" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "event-listener" +version = "5.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" +dependencies = [ + "event-listener", + "pin-project-lite", +] + +[[package]] +name = "fastrand" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "flate2" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-executor" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" + +[[package]] +name = "futures-macro" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi 5.3.0", + "wasip2", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" +dependencies = [ + "cfg-if", + "libc", + "r-efi 6.0.0", + "wasip2", + "wasip3", +] + +[[package]] +name = "git2" +version = "0.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b88256088d75a56f8ecfa070513a775dd9107f6530ef14919dac831af9cfe2b" +dependencies = [ + "bitflags", + "libc", + "libgit2-sys", + "log", + "url", +] + +[[package]] +name = "gloo-timers" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "home" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "hostname" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "617aaa3557aef3810a6369d0a99fac8a080891b68bd9f9812a1eeda0c0730cbd" +dependencies = [ + "cfg-if", + "libc", + "windows-link", +] + +[[package]] +name = "http" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6299f016b246a94207e63da54dbe807655bf9e00044f73ded42c3ac5305fbcca" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" +dependencies = [ + "http", + "hyper", + "hyper-util", + "log", + "rustls", + "rustls-native-certs", + "tokio", + "tokio-rustls", + "tower-service", + "webpki-roots", +] + +[[package]] +name = "hyper-timeout" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" +dependencies = [ + "hyper", + "hyper-util", + "pin-project-lite", + "tokio", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +dependencies = [ + "base64", + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_collections" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" + +[[package]] +name = "icu_properties" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" + +[[package]] +name = "icu_provider" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +dependencies = [ + "equivalent", + "hashbrown 0.17.1", + "serde", + "serde_core", +] + +[[package]] +name = "ipnet" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" + +[[package]] +name = "is_debug" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fe266d2e243c931d8190177f20bf7f24eed45e96f39e87dc49a27b32d12d407" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "jobserver" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +dependencies = [ + "getrandom 0.3.4", + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67df7112613f8bfd9150013a0314e196f4800d3201ae742489d999db2f979f08" +dependencies = [ + "cfg-if", + "futures-util", + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "json-patch" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7421438de105a0827e44fadd05377727847d717c80ce29a229f85fd04c427b72" +dependencies = [ + "jsonptr", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "jsonpath-rust" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c00ae348f9f8fd2d09f82a98ca381c60df9e0820d8d79fce43e649b4dc3128b" +dependencies = [ + "pest", + "pest_derive", + "regex", + "serde_json", + "thiserror", +] + +[[package]] +name = "jsonptr" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5a3cc660ba5d72bce0b3bb295bf20847ccbb40fd423f3f05b61273672e561fe" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "jsonwebtoken" +version = "9.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a87cc7a48537badeae96744432de36f4be2b4a34a05a5ef32e9dd8a1c169dde" +dependencies = [ + "base64", + "js-sys", + "pem", + "ring", + "serde", + "serde_json", + "simple_asn1", +] + +[[package]] +name = "k8s-openapi" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06d9e5e61dd037cdc51da0d7e2b2be10f497478ea7e120d85dad632adb99882b" +dependencies = [ + "base64", + "chrono", + "schemars", + "serde", + "serde_json", +] + +[[package]] +name = "konst" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "128133ed7824fcd73d6e7b17957c5eb7bacb885649bd8c69708b2331a10bcefb" +dependencies = [ + "konst_macro_rules", +] + +[[package]] +name = "konst_macro_rules" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4933f3f57a8e9d9da04db23fb153356ecaf00cbd14aee46279c33dc80925c37" + +[[package]] +name = "kube" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e7bb0b6a46502cc20e4575b6ff401af45cfea150b34ba272a3410b78aa014e" +dependencies = [ + "k8s-openapi", + "kube-client", + "kube-core", + "kube-derive", + "kube-runtime", +] + +[[package]] +name = "kube-client" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4987d57a184d2b5294fdad3d7fc7f278899469d21a4da39a8f6ca16426567a36" +dependencies = [ + "base64", + "bytes", + "chrono", + "either", + "futures", + "home", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-timeout", + "hyper-util", + "jsonpath-rust", + "k8s-openapi", + "kube-core", + "pem", + "rustls", + "secrecy", + "serde", + "serde_json", + "serde_yaml", + "thiserror", + "tokio", + "tokio-util", + "tower", + "tower-http", + "tracing", +] + +[[package]] +name = "kube-core" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "914bbb770e7bb721a06e3538c0edd2babed46447d128f7c21caa68747060ee73" +dependencies = [ + "chrono", + "derive_more", + "form_urlencoded", + "http", + "json-patch", + "k8s-openapi", + "schemars", + "serde", + "serde-value", + "serde_json", + "thiserror", +] + +[[package]] +name = "kube-derive" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03dee8252be137772a6ab3508b81cd797dee62ee771112a2453bc85cbbe150d2" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "serde", + "serde_json", + "syn", +] + +[[package]] +name = "kube-runtime" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6aea4de4b562c5cc89ab10300bb63474ae1fa57ff5a19275f2e26401a323e3fd" +dependencies = [ + "ahash", + "async-broadcast", + "async-stream", + "backon", + "educe", + "futures", + "hashbrown 0.15.5", + "hostname", + "json-patch", + "k8s-openapi", + "kube-client", + "parking_lot", + "pin-project", + "serde", + "serde_json", + "thiserror", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + +[[package]] +name = "libc" +version = "0.2.186" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" + +[[package]] +name = "libgit2-sys" +version = "0.18.4+1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b26f66f35e1871b22efcf7191564123d2a446ca0538cde63c23adfefa9b15b7" +dependencies = [ + "cc", + "libc", + "libz-sys", + "pkg-config", +] + +[[package]] +name = "libz-sys" +version = "1.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc3a226e576f50782b3305c5ccf458698f92798987f551c6a02efe8276721e22" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "litemap" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" + +[[package]] +name = "litrs" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + +[[package]] +name = "matchers" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6673768db2d862beb9b39a78fdcb1a69439615d5794a1be50caa9bc92c81967" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_threads" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +dependencies = [ + "libc", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "openssl-probe" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" + +[[package]] +name = "operator" +version = "0.1.0" +dependencies = [ + "axum", + "chrono", + "clap", + "const-str", + "futures", + "http", + "jsonwebtoken", + "k8s-openapi", + "kube", + "rustls", + "rustls-pemfile", + "schemars", + "serde", + "serde_json", + "serde_yaml_ng", + "shadow-rs", + "snafu", + "strum", + "tokio", + "tokio-stream", + "tokio-util", + "tower", + "tower-http", + "tracing", + "tracing-subscriber", + "utoipa", + "utoipa-swagger-ui", +] + +[[package]] +name = "ordered-float" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" +dependencies = [ + "num-traits", +] + +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "pem" +version = "3.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d30c53c26bc5b31a98cd02d20f25a7c8567146caf63ed593a9d87b2775291be" +dependencies = [ + "base64", + "serde_core", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pest" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0848c601009d37dfa3430c4666e147e49cdcf1b92ecd3e63657d8a5f19da662" +dependencies = [ + "memchr", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11f486f1ea21e6c10ed15d5a7c77165d0ee443402f0780849d1768e7d9d6fe77" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8040c4647b13b210a963c1ed407c1ff4fdfa01c31d6d2a098218702e6664f94f" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pest_meta" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89815c69d36021a140146f26659a81d6c2afa33d216d736dd4be5381a7362220" +dependencies = [ + "pest", + "sha2", +] + +[[package]] +name = "pin-project" +version = "1.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf0d9e68100b3a7989b4901972f265cd542e560a3a8a724e1e20322f4d06ce9" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a990e22f43e84855daf260dded30524ef4a9021cc7541c26540500a50b624389" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pkg-config" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" + +[[package]] +name = "potential_utf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "psl-types" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33cb294fe86a74cbcf50d4445b37da762029549ebeea341421c7c70370f86cac" + +[[package]] +name = "publicsuffix" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42ea446cab60335f76979ec15e12619a2165b5ae2c12166bef27d283a9fadf" +dependencies = [ + "idna", + "psl-types", +] + +[[package]] +name = "quinn" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" +dependencies = [ + "bytes", + "getrandom 0.3.4", + "lru-slab", + "rand", + "ring", + "rustc-hash", + "rustls", + "rustls-pki-types", + "slab", + "thiserror", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.60.2", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "rand" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "ref-cast" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "regex" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" + +[[package]] +name = "reqwest" +version = "0.12.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" +dependencies = [ + "base64", + "bytes", + "cookie", + "cookie_store", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "js-sys", + "log", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-rustls", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "webpki-roots", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rust-embed" +version = "8.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04113cb9355a377d83f06ef1f0a45b8ab8cd7d8b1288160717d66df5c7988d27" +dependencies = [ + "rust-embed-impl", + "rust-embed-utils", + "walkdir", +] + +[[package]] +name = "rust-embed-impl" +version = "8.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0902e4c7c8e997159ab384e6d0fc91c221375f6894346ae107f47dd0f3ccaa" +dependencies = [ + "proc-macro2", + "quote", + "rust-embed-utils", + "syn", + "walkdir", +] + +[[package]] +name = "rust-embed-utils" +version = "8.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bcdef0be6fe7f6fa333b1073c949729274b05f123a0ad7efcb8efd878e5c3b1" +dependencies = [ + "sha2", + "walkdir", +] + +[[package]] +name = "rustc-hash" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustfs-operator-e2e" +version = "0.1.0" +dependencies = [ + "anyhow", + "futures", + "k8s-openapi", + "kube", + "operator", + "reqwest", + "serde", + "serde_json", + "serde_yaml_ng", + "tempfile", + "tokio", + "uuid", +] + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls" +version = "0.23.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef86cd5876211988985292b91c96a8f2d298df24e75989a43a3c73f2d4d8168b" +dependencies = [ + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-native-certs" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30a7197ae7eb376e574fe940d068c30fe0462554a3ddbe4eca7838e049c937a9" +dependencies = [ + "web-time", + "zeroize", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "schemars" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2b42f36aa1cd011945615b92222f6bf73c599a102a300334cd7f8dbeec726cc" +dependencies = [ + "dyn-clone", + "ref-cast", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d115b50f4aaeea07e79c1912f645c7513d81715d0420f8bc77a18c6260b307f" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "secrecy" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e891af845473308773346dc847b2c23ee78fe442e0472ac50e22a18a93d3ae5a" +dependencies = [ + "zeroize", +] + +[[package]] +name = "security-framework" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde-value" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" +dependencies = [ + "ordered-float", + "serde", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" +dependencies = [ + "itoa", + "serde", + "serde_core", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + +[[package]] +name = "serde_yaml_ng" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4db627b98b36d4203a7b458cf3573730f2bb591b28871d916dfa9efabfd41f" +dependencies = [ + "indexmap", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shadow-rs" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c798acfc78a69c7b038adde44084d8df875555b091da42c90ae46257cdcc41a" +dependencies = [ + "const_format", + "git2", + "is_debug", + "time", + "tzdb", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "simd-adler32" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" + +[[package]] +name = "simple_asn1" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d585997b0ac10be3c5ee635f1bab02d512760d14b7c468801ac8a01d9ae5f1d" +dependencies = [ + "num-bigint", + "num-traits", + "thiserror", + "time", +] + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "snafu" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e84b3f4eacbf3a1ce05eac6763b4d629d60cbc94d632e4092c54ade71f1e1a2" +dependencies = [ + "futures-core", + "pin-project", + "snafu-derive", +] + +[[package]] +name = "snafu-derive" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1c97747dbf44bb1ca44a561ece23508e99cb592e862f22222dcf42f51d1e451" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "socket2" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af23d6f6c1a224baef9d3f61e287d2761385a5b88fdab4eb4c6f11aeb54c4bcf" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7695ce3845ea4b33927c055a39dc438a45b059f7c1b3d91d38d10355fb8cbca7" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +dependencies = [ + "fastrand", + "getrandom 0.4.2", + "once_cell", + "rustix", + "windows-sys 0.61.2", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "time" +version = "0.3.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" +dependencies = [ + "deranged", + "itoa", + "libc", + "num-conv", + "num_threads", + "powerfmt", + "serde_core", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" + +[[package]] +name = "time-macros" +version = "0.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe" +dependencies = [ + "bytes", + "libc", + "mio", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", + "tokio-util", +] + +[[package]] +name = "tokio-util" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +dependencies = [ + "bytes", + "futures-core", + "futures-io", + "futures-sink", + "pin-project-lite", + "slab", + "tokio", +] + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-http" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68d6fdd9f81c2819c9a8b0e0cd91660e7746a8e6ea2ba7c6b2b057985f6bcb51" +dependencies = [ + "async-compression", + "base64", + "bitflags", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "mime", + "pin-project-lite", + "tokio", + "tokio-util", + "tower", + "tower-layer", + "tower-service", + "tracing", + "url", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex-automata", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typenum" +version = "1.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ce102ab67701b8526c123c1bab5cbe42d7040ccfd0f64af1a385808d2f43de" + +[[package]] +name = "tz-rs" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fc6c929ffa10fb34f4a3c7e9a73620a83ef2e85e47f9ec3381b8289e6762f42" + +[[package]] +name = "tzdb" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56d4e985b6dda743ae7fd4140c28105316ffd75bc58258ee6cc12934e3eb7a0c" +dependencies = [ + "iana-time-zone", + "tz-rs", + "tzdb_data", +] + +[[package]] +name = "tzdb_data" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "125a0a63c4bd75c73f61863463cb400db4b1aa5039b203b0ee1d628a7e3dabb2" +dependencies = [ + "tz-rs", +] + +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + +[[package]] +name = "unicase" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "utoipa" +version = "5.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bde15df68e80b16c7d16b9616e80770ad158988daa56a27dccd1e55558b0160" +dependencies = [ + "indexmap", + "serde", + "serde_json", + "utoipa-gen", +] + +[[package]] +name = "utoipa-gen" +version = "5.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba0b99ee52df3028635d93840c797102da61f8a7bb3cf751032455895b52ef8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "utoipa-swagger-ui" +version = "8.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db4b5ac679cc6dfc5ea3f2823b0291c777750ffd5e13b21137e0f7ac0e8f9617" +dependencies = [ + "axum", + "base64", + "mime_guess", + "regex", + "rust-embed", + "serde", + "serde_json", + "url", + "utoipa", + "utoipa-swagger-ui-vendored", + "zip", +] + +[[package]] +name = "utoipa-swagger-ui-vendored" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2eebbbfe4093922c2b6734d7c679ebfebd704a0d7e56dfcb0d05818ce28977d" + +[[package]] +name = "uuid" +version = "1.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd74a9687298c6858e9b88ec8935ec45d22e8fd5e6394fa1bd4e99a87789c76" +dependencies = [ + "getrandom 0.4.2", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.3+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6" +dependencies = [ + "wit-bindgen 0.57.1", +] + +[[package]] +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +dependencies = [ + "wit-bindgen 0.51.0", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.121" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49ace1d07c165b0864824eee619580c4689389afa9dc9ed3a4c75040d82e6790" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96492d0d3ffba25305a7dc88720d250b1401d7edca02cc3bcd50633b424673b8" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.121" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e68e6f4afd367a562002c05637acb8578ff2dea1943df76afb9e83d177c8578" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.121" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d95a9ec35c64b2a7cb35d3fead40c4238d0940c86d107136999567a4703259f2" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.121" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4e0100b01e9f0d03189a92b96772a1fb998639d981193d7dbab487302513441" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasm-streams" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags", + "hashbrown 0.15.5", + "indexmap", + "semver", +] + +[[package]] +name = "web-sys" +version = "0.3.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b572dff8bcf38bad0fa19729c89bb5748b2b9b1d8be70cf90df697e3a8f32aa" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52f5ee44c96cf55f1b349600768e3ece3a8f26010c05265ab73f945bb1a2eb9d" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + +[[package]] +name = "wit-bindgen-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "prettyplease", + "syn", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + +[[package]] +name = "writeable" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" + +[[package]] +name = "yoke" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerofrom" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69faa1f2a1ea75661980b013019ed6687ed0e83d069bc1114e2cc74c6c04c4df" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" + +[[package]] +name = "zerotrie" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zip" +version = "2.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fabe6324e908f85a1c52063ce7aa26b68dcb7eb6dbc83a2d148403c9bc3eba50" +dependencies = [ + "arbitrary", + "crc32fast", + "crossbeam-utils", + "displaydoc", + "flate2", + "indexmap", + "memchr", + "thiserror", + "zopfli", +] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" + +[[package]] +name = "zopfli" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f05cd8797d63865425ff89b5c4a48804f35ba0ce8d125800027ad6017d2b5249" +dependencies = [ + "bumpalo", + "crc32fast", + "log", + "simd-adler32", +] diff --git a/e2e/Cargo.toml b/e2e/Cargo.toml new file mode 100644 index 0000000..8bd2fe5 --- /dev/null +++ b/e2e/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "rustfs-operator-e2e" +version = "0.1.0" +edition = "2024" +publish = false + +[dependencies] +operator = { path = ".." } + +anyhow = "1" +futures = "0.3.31" +serde = { version = "1.0.228", features = ["derive"] } +serde_json = "1.0.148" +serde_yaml_ng = "0.10.0" +tempfile = "3" +tokio = { version = "1.49.0", features = ["rt-multi-thread", "macros", "process", "time", "io-util"] } +uuid = { version = "1", features = ["v4"] } + +k8s-openapi = { version = "0.26.1", features = ["v1_30", "schemars"] } +kube = { version = "2.0.1", features = ["runtime", "derive", "client", "rustls-tls"] } +reqwest = { version = "0.12", default-features = false, features = ["cookies", "json", "rustls-tls", "stream"] } diff --git a/e2e/README.md b/e2e/README.md new file mode 100644 index 0000000..b8f797c --- /dev/null +++ b/e2e/README.md @@ -0,0 +1,127 @@ +# RustFS Operator E2E Harness + +This crate is the Rust-native integration-test harness for release-grade validation of the RustFS Operator and its Console API. + +The harness is intentionally separated from the main operator crate so e2e-only dependencies stay scoped to the `e2e/` manifest while still being validated by `make e2e-check` and the default `make pre-commit` path. It is driven through the reduced live entrypoints `e2e-live-create`, `e2e-live-run`, `e2e-live-update`, and `e2e-live-delete`. + +## Architecture + +The harness is split into four top-level domains: + +- `manifests/`: e2e-owned static manifests such as the dedicated Kind config. +- `framework/`: reusable infrastructure primitives. +- `cases/`: release test-case inventory grouped by product boundary. +- `tests/`: executable suite entrypoints; live tests are ignored by default and run only through explicit Make targets. + +```text +e2e/ + Cargo.toml + manifests/ + kind-rustfs-e2e.yaml dedicated 1 control-plane + 3 worker Kind cluster + src/ + lib.rs + bin/rustfs-e2e.rs Makefile-internal helper for live workflow steps + framework/ + config.rs environment and CI knobs + command.rs safe subprocess wrapper for kind/docker/kubectl + kind.rs Kind cluster lifecycle and host mount preparation + kubectl.rs kubectl command construction boundary + live.rs live-run guardrails and context safety + tools.rs local host tool inventory + kube_client.rs kube-rs client boundary + console_client.rs reqwest Console API boundary + wait.rs timeout/polling helpers and Tenant Ready wait + artifacts.rs failure artifact collection boundary + port_forward.rs kubectl port-forward boundary + images.rs operator/console/rustfs image set boundary + resources.rs namespace/Secret/Tenant apply boundary + storage.rs local StorageClass/PV preparation boundary + assertions.rs Kubernetes and Tenant status assertions + tenant_factory.rs reusable Tenant manifests for e2e + cases/ + smoke.rs install and readiness checks + operator.rs Tenant status and observed-generation checks + console.rs Console API health/readiness/OpenAPI checks + tests/ + smoke.rs ignored live smoke entrypoints + operator.rs ignored live Operator assertion + console.rs ignored live Console API assertion + faults.rs non-live destructive opt-in guard +``` + +## Boundary rules + +1. `framework::command` is the only layer that should execute host commands directly. +2. `framework::kubectl` is the shell/Kubernetes YAML boundary and must always pin `--context`. +3. `framework::kube_client` is the typed Kubernetes API boundary. +4. `framework::console_client` is the HTTP boundary for Console API tests. +5. `framework::storage` owns e2e local PV setup; `framework::resources` owns e2e namespace/Secret/Tenant setup. +6. `framework::live` owns live-run opt-in and dedicated-context checks. +7. `cases/*` should describe behavior and call framework helpers; avoid shell details there. +8. Destructive tests must use dedicated e2e namespaces and must never run against an arbitrary current context. + +## Safety defaults + +Default configuration targets a dedicated Kind cluster: + +```text +cluster: rustfs-e2e +context: kind-rustfs-e2e +operator ns: rustfs-system +test namespace: rustfs-e2e-smoke +tenant name: e2e-tenant +console URL: http://127.0.0.1:19090 +rustfs image: rustfs/rustfs:latest +storage class: local-storage +PV count: 12 +kind config: e2e/manifests/kind-rustfs-e2e.yaml +``` + +Live tests are `#[ignore]` and run through the reduced Make workflow. The Makefile injects `RUSTFS_E2E_LIVE=1` internally, so the common flow does not need the environment prefix: + +```bash +make e2e-live-run +``` + +The harness refuses to run live tests unless the active Kubernetes context matches the configured dedicated Kind context. + +## Non-live validation + +```bash +make e2e-check +``` + +This runs e2e formatting, non-live tests, and clippy. Live tests remain `#[ignore]` and require the live commands below. + +## Usage (four common entry points) + +- `make e2e-live-create`: + Creates the dedicated live environment: builds the e2e image, removes old `kind-rustfs-e2e`, cleans dedicated storage, then performs create + image load. +- `make e2e-live-run`: + Runs all live suites (smoke/operator/console) in an existing live environment. +- `make e2e-live-update`: + Rebuilds the e2e image and updates it into the live environment (`load + rollout`). + Prerequisite: control-plane components must already be deployed (usually after `make e2e-live-run`). +- `make e2e-live-delete`: + Deletes the live cluster and cleans dedicated storage at `/tmp/rustfs-e2e-storage-{1,2,3}`. + +Image builds use Docker host network internally to avoid local bridge DNS resolution issues for npm/crates registries; the exposed user entry points remain only these four commands. + +Recommended workflow: + +```bash +# Initial setup +make e2e-live-create + +# Run all suites once (deploys control plane and creates tenant) +make e2e-live-run + +# Rebuild image and restart deployment after code changes +make e2e-live-update + +# Run suites again after rollout +make e2e-live-run + +# Clean up +make e2e-live-delete +``` diff --git a/e2e/manifests/kind-rustfs-e2e.yaml b/e2e/manifests/kind-rustfs-e2e.yaml new file mode 100644 index 0000000..52d9897 --- /dev/null +++ b/e2e/manifests/kind-rustfs-e2e.yaml @@ -0,0 +1,46 @@ +# Kind cluster configuration for RustFS Operator e2e runs. +# Keep this file dedicated to e2e so release tests never reuse the demo cluster. +kind: Cluster +apiVersion: kind.x-k8s.io/v1alpha4 +name: rustfs-e2e +nodes: + - role: control-plane + kubeadmConfigPatches: + - | + kind: InitConfiguration + nodeRegistration: + kubeletExtraArgs: + node-labels: "ingress-ready=true" + + - role: worker + kubeadmConfigPatches: + - | + kind: JoinConfiguration + nodeRegistration: + kubeletExtraArgs: + node-labels: "worker-group=storage-1,rustfs-storage=true" + extraMounts: + - hostPath: /tmp/rustfs-e2e-storage-1 + containerPath: /mnt/data + + - role: worker + kubeadmConfigPatches: + - | + kind: JoinConfiguration + nodeRegistration: + kubeletExtraArgs: + node-labels: "worker-group=storage-2,rustfs-storage=true" + extraMounts: + - hostPath: /tmp/rustfs-e2e-storage-2 + containerPath: /mnt/data + + - role: worker + kubeadmConfigPatches: + - | + kind: JoinConfiguration + nodeRegistration: + kubeletExtraArgs: + node-labels: "worker-group=storage-3,rustfs-storage=true" + extraMounts: + - hostPath: /tmp/rustfs-e2e-storage-3 + containerPath: /mnt/data diff --git a/e2e/src/bin/rustfs-e2e.rs b/e2e/src/bin/rustfs-e2e.rs new file mode 100644 index 0000000..a698a40 --- /dev/null +++ b/e2e/src/bin/rustfs-e2e.rs @@ -0,0 +1,121 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use anyhow::{Result, bail}; +use rustfs_operator_e2e::framework::{ + command::CommandSpec, config::E2eConfig, deploy, images::ImageSet, kind::KindCluster, live, +}; + +fn main() -> Result<()> { + let command = std::env::args() + .nth(1) + .unwrap_or_else(|| "help".to_string()); + let config = E2eConfig::from_env(); + + match command.as_str() { + "help" | "--help" | "-h" => print_help(), + "assert-context" => assert_context(&config), + "kind-create" => create_kind_cluster(&config), + "kind-delete" => delete_kind_cluster(&config), + "kind-load-images" => load_images(&config), + "deploy-dev" => deploy_dev(&config), + "rollout-dev" => rollout_dev(&config), + unknown => bail!("unknown rustfs-e2e internal command: {unknown}; run `rustfs-e2e help`"), + } +} + +fn print_help() -> Result<()> { + println!("RustFS Operator e2e internal helper"); + println!(); + println!("Operator-facing workflow:"); + println!(" make e2e-live-create"); + println!(" make e2e-live-run"); + println!(" make e2e-live-update"); + println!(" make e2e-live-delete"); + println!(); + println!("Makefile-internal commands:"); + println!(" assert-context Require RUSTFS_E2E_LIVE=1 and dedicated Kind context"); + println!(" kind-create Create the dedicated Kind cluster"); + println!(" kind-delete Delete the dedicated Kind cluster and storage"); + println!(" kind-load-images Load operator, console-web, and RustFS images into Kind"); + println!(" deploy-dev Apply operator/console manifests into dedicated Kind"); + println!(" rollout-dev Restart and wait for e2e control-plane deployments"); + Ok(()) +} + +fn assert_context(config: &E2eConfig) -> Result<()> { + live::require_live_enabled(config)?; + let context = live::ensure_dedicated_context(config)?; + println!("confirmed dedicated e2e context: {context}"); + Ok(()) +} + +fn create_kind_cluster(config: &E2eConfig) -> Result<()> { + live::require_live_enabled(config)?; + let kind = KindCluster::new(config.clone()); + kind.reset_host_storage_dirs()?; + kind.create_command().run_checked()?; + Ok(()) +} + +fn delete_kind_cluster(config: &E2eConfig) -> Result<()> { + live::require_live_enabled(config)?; + let kind = KindCluster::new(config.clone()); + kind.delete_command().run_checked()?; + kind.cleanup_host_storage_dirs()?; + Ok(()) +} + +fn load_images(config: &E2eConfig) -> Result<()> { + live::require_live_enabled(config)?; + + let images = ImageSet::from_config(config); + for image in images.all() { + if !host_image_exists(image) { + println!("pulling {image} to host"); + CommandSpec::new("docker") + .args(["pull", image]) + .run_checked()?; + } + } + + let kind = KindCluster::new(config.clone()); + for image in images.all() { + println!("loading {image} into {}", config.cluster_name); + kind.load_image_command(image).run_checked()?; + } + Ok(()) +} + +fn host_image_exists(image: &str) -> bool { + match CommandSpec::new("docker") + .args(["image", "inspect", image]) + .run() + { + Ok(output) => output.code == Some(0), + Err(_) => false, + } +} + +fn deploy_dev(config: &E2eConfig) -> Result<()> { + live::require_live_enabled(config)?; + live::ensure_dedicated_context(config)?; + deploy::deploy_dev(config) +} + +fn rollout_dev(config: &E2eConfig) -> Result<()> { + live::require_live_enabled(config)?; + live::ensure_dedicated_context(config)?; + deploy::rollout_dev(config) +} diff --git a/e2e/src/cases/console.rs b/e2e/src/cases/console.rs new file mode 100644 index 0000000..02ead1a --- /dev/null +++ b/e2e/src/cases/console.rs @@ -0,0 +1,43 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use super::{CaseSpec, Suite}; + +pub fn cases() -> Vec { + vec![CaseSpec::new( + Suite::Console, + "console_live_health_ready_and_openapi_are_available", + "Start a scoped Console API port-forward and verify /healthz, /readyz, and OpenAPI availability.", + "console/http", + "console", + )] +} + +#[cfg(test)] +mod tests { + use super::cases; + + #[test] + fn console_case_inventory_matches_executable_tests() { + let names = cases() + .into_iter() + .map(|case| case.name) + .collect::>(); + + assert_eq!( + names, + vec!["console_live_health_ready_and_openapi_are_available"] + ); + } +} diff --git a/e2e/src/cases/mod.rs b/e2e/src/cases/mod.rs new file mode 100644 index 0000000..02fcef3 --- /dev/null +++ b/e2e/src/cases/mod.rs @@ -0,0 +1,115 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +pub mod console; +pub mod operator; +pub mod smoke; + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +pub enum Suite { + Smoke, + Operator, + Console, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub struct CaseSpec { + pub suite: Suite, + pub name: &'static str, + pub description: &'static str, + pub boundary: &'static str, + pub ci_phase: &'static str, +} + +impl CaseSpec { + pub const fn new( + suite: Suite, + name: &'static str, + description: &'static str, + boundary: &'static str, + ci_phase: &'static str, + ) -> Self { + Self { + suite, + name, + description, + boundary, + ci_phase, + } + } +} + +pub fn all_cases() -> Vec { + let mut cases = Vec::new(); + cases.extend(smoke::cases()); + cases.extend(operator::cases()); + cases.extend(console::cases()); + cases +} + +#[cfg(test)] +mod tests { + use super::{Suite, all_cases}; + use std::collections::{HashMap, HashSet}; + + #[test] + fn release_plan_has_clear_suite_boundaries() { + let cases = all_cases(); + let suites = cases.iter().map(|case| case.suite).collect::>(); + + assert!(suites.contains(&Suite::Smoke)); + assert!(suites.contains(&Suite::Operator)); + assert!(suites.contains(&Suite::Console)); + } + + #[test] + fn case_names_are_unique() { + let mut seen = HashSet::new(); + for case in all_cases() { + assert!( + seen.insert(case.name), + "duplicate e2e case name: {}", + case.name + ); + } + } + + #[test] + fn cases_are_mapped_to_ci_phases_and_architecture_boundaries() { + let missing = all_cases() + .into_iter() + .filter(|case| case.boundary.is_empty() || case.ci_phase.is_empty()) + .map(|case| case.name) + .collect::>(); + + assert!( + missing.is_empty(), + "cases missing boundary/ci phase: {missing:?}" + ); + } + + #[test] + fn executable_cases_are_present_for_each_suite() { + let counts = all_cases() + .into_iter() + .fold(HashMap::new(), |mut acc, case| { + *acc.entry(case.suite).or_insert(0usize) += 1; + acc + }); + + assert_eq!(counts.get(&Suite::Smoke).copied().unwrap_or_default(), 3); + assert_eq!(counts.get(&Suite::Operator).copied().unwrap_or_default(), 1); + assert_eq!(counts.get(&Suite::Console).copied().unwrap_or_default(), 1); + } +} diff --git a/e2e/src/cases/operator.rs b/e2e/src/cases/operator.rs new file mode 100644 index 0000000..2f80cda --- /dev/null +++ b/e2e/src/cases/operator.rs @@ -0,0 +1,40 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use super::{CaseSpec, Suite}; + +pub fn cases() -> Vec { + vec![CaseSpec::new( + Suite::Operator, + "operator_live_tenant_is_ready_and_observed", + "Assert the live Tenant is Ready, not Degraded, and has observed the current generation.", + "operator/status", + "operator", + )] +} + +#[cfg(test)] +mod tests { + use super::cases; + + #[test] + fn operator_case_inventory_matches_executable_tests() { + let names = cases() + .into_iter() + .map(|case| case.name) + .collect::>(); + + assert_eq!(names, vec!["operator_live_tenant_is_ready_and_observed"]); + } +} diff --git a/e2e/src/cases/smoke.rs b/e2e/src/cases/smoke.rs new file mode 100644 index 0000000..8c855bf --- /dev/null +++ b/e2e/src/cases/smoke.rs @@ -0,0 +1,63 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use super::{CaseSpec, Suite}; + +pub fn cases() -> Vec { + vec![ + CaseSpec::new( + Suite::Smoke, + "smoke_dedicated_context_is_active", + "Assert live execution is explicitly enabled and the active kube context is the dedicated Kind context.", + "live-safety/context", + "smoke", + ), + CaseSpec::new( + Suite::Smoke, + "smoke_control_plane_deployments_are_ready", + "Verify all e2e control-plane deployments have completed Kubernetes rollout.", + "control-plane/rollout", + "smoke", + ), + CaseSpec::new( + Suite::Smoke, + "smoke_apply_tenant_and_wait_ready", + "Prepare local storage, apply a Tenant with credentials, and wait for Tenant Ready status.", + "operator/reconcile", + "smoke", + ), + ] +} + +#[cfg(test)] +mod tests { + use super::cases; + + #[test] + fn smoke_case_inventory_matches_executable_tests() { + let names = cases() + .into_iter() + .map(|case| case.name) + .collect::>(); + + assert_eq!( + names, + vec![ + "smoke_dedicated_context_is_active", + "smoke_control_plane_deployments_are_ready", + "smoke_apply_tenant_and_wait_ready", + ] + ); + } +} diff --git a/e2e/src/framework/artifacts.rs b/e2e/src/framework/artifacts.rs new file mode 100644 index 0000000..cd8c9dd --- /dev/null +++ b/e2e/src/framework/artifacts.rs @@ -0,0 +1,125 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use anyhow::Result; +use std::fs; +use std::path::{Path, PathBuf}; + +use crate::framework::{config::E2eConfig, kubectl::Kubectl}; + +#[derive(Debug, Clone)] +pub struct ArtifactCollector { + root: PathBuf, +} + +impl ArtifactCollector { + pub fn new(root: impl Into) -> Self { + Self { root: root.into() } + } + + pub fn case_dir(&self, case_name: &str) -> PathBuf { + self.root.join(sanitize_case_name(case_name)) + } + + pub fn write_text(&self, case_name: &str, file_name: &str, content: &str) -> Result { + let dir = self.case_dir(case_name); + fs::create_dir_all(&dir)?; + let path = dir.join(file_name); + fs::write(&path, content)?; + Ok(path) + } + + pub fn root(&self) -> &Path { + &self.root + } + + pub fn collect_kubernetes_snapshot(&self, case_name: &str, config: &E2eConfig) -> Result<()> { + let kubectl = Kubectl::new(config); + let operator_kubectl = Kubectl::new(config).namespaced(&config.operator_namespace); + let test_kubectl = Kubectl::new(config).namespaced(&config.test_namespace); + + let commands = vec![ + ( + "get-all.txt", + kubectl.command(["get", "all", "-A", "-o", "wide"]), + ), + ( + "tenants.yaml", + kubectl.command(["get", "tenants", "-A", "-o", "yaml"]), + ), + ( + "events.txt", + kubectl.command(["get", "events", "-A", "--sort-by=.lastTimestamp"]), + ), + ( + "operator.log", + operator_kubectl.command(["logs", "deployment/rustfs-operator", "--tail=500"]), + ), + ( + "console.log", + operator_kubectl.command([ + "logs", + "deployment/rustfs-operator-console", + "--tail=500", + ]), + ), + ( + "test-namespace-pods.txt", + test_kubectl.command(["get", "pods", "-o", "wide"]), + ), + ]; + + for (file_name, command) in commands { + let output = command.run()?; + let content = format!( + "$ {cmd}\nexit: {code:?}\n\nstdout:\n{stdout}\n\nstderr:\n{stderr}\n", + cmd = command.display(), + code = output.code, + stdout = output.stdout, + stderr = output.stderr + ); + self.write_text(case_name, file_name, &content)?; + } + + Ok(()) + } +} + +fn sanitize_case_name(case_name: &str) -> String { + case_name + .chars() + .map(|ch| { + if ch.is_ascii_alphanumeric() || ch == '-' || ch == '_' { + ch + } else { + '_' + } + }) + .collect() +} + +#[cfg(test)] +mod tests { + use super::ArtifactCollector; + + #[test] + fn artifact_paths_are_case_scoped_and_sanitized() { + let collector = ArtifactCollector::new("target/e2e/artifacts"); + + assert_eq!( + collector.case_dir("console auth/session"), + std::path::PathBuf::from("target/e2e/artifacts/console_auth_session") + ); + } +} diff --git a/e2e/src/framework/assertions.rs b/e2e/src/framework/assertions.rs new file mode 100644 index 0000000..39023bb --- /dev/null +++ b/e2e/src/framework/assertions.rs @@ -0,0 +1,94 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use anyhow::{Result, bail, ensure}; +use operator::types::v1alpha1::tenant::Tenant; + +pub fn current_state(tenant: &Tenant) -> Option<&str> { + tenant + .status + .as_ref() + .map(|status| status.current_state.as_str()) +} + +pub fn condition_status<'a>(tenant: &'a Tenant, condition_type: &str) -> Option<&'a str> { + tenant + .status + .as_ref()? + .conditions + .iter() + .find(|condition| condition.type_ == condition_type) + .map(|condition| condition.status.as_str()) +} + +pub fn require_condition( + tenant: &Tenant, + condition_type: &str, + expected_status: &str, +) -> Result<()> { + match condition_status(tenant, condition_type) { + Some(actual) if actual == expected_status => Ok(()), + Some(actual) => { + bail!("condition {condition_type} expected {expected_status}, got {actual}") + } + None => bail!("condition {condition_type} not found"), + } +} + +pub fn require_observed_generation_current(tenant: &Tenant) -> Result<()> { + let generation = tenant.metadata.generation; + let observed = tenant + .status + .as_ref() + .and_then(|status| status.observed_generation); + + ensure!( + generation.is_some(), + "tenant metadata.generation is missing" + ); + ensure!( + observed == generation, + "tenant observedGeneration {observed:?} does not match generation {generation:?}" + ); + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::{condition_status, current_state, require_condition}; + use operator::types::v1alpha1::status::{Condition, Status}; + use operator::types::v1alpha1::tenant::{Tenant, TenantSpec}; + + #[test] + fn tenant_condition_helpers_find_status_by_type() { + let mut tenant = Tenant::new("tenant-a", TenantSpec::default()); + tenant.status = Some(Status { + current_state: "Ready".to_string(), + conditions: vec![Condition { + type_: "Ready".to_string(), + status: "True".to_string(), + last_transition_time: None, + observed_generation: Some(1), + reason: "ReconcileSucceeded".to_string(), + message: "ready".to_string(), + }], + ..Status::default() + }); + + assert_eq!(current_state(&tenant), Some("Ready")); + assert_eq!(condition_status(&tenant, "Ready"), Some("True")); + assert!(require_condition(&tenant, "Ready", "True").is_ok()); + assert!(require_condition(&tenant, "Ready", "False").is_err()); + } +} diff --git a/e2e/src/framework/command.rs b/e2e/src/framework/command.rs new file mode 100644 index 0000000..f765428 --- /dev/null +++ b/e2e/src/framework/command.rs @@ -0,0 +1,183 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use anyhow::{Context, Result, bail}; +use std::fs::OpenOptions; +use std::io::Write; +use std::path::{Path, PathBuf}; +use std::process::{Child, Command, Stdio}; + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct CommandSpec { + pub program: String, + pub args: Vec, + pub cwd: Option, + pub stdin: Option, +} + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct CommandOutput { + pub code: Option, + pub stdout: String, + pub stderr: String, +} + +impl CommandSpec { + pub fn new(program: impl Into) -> Self { + Self { + program: program.into(), + args: Vec::new(), + cwd: None, + stdin: None, + } + } + + pub fn arg(mut self, arg: impl Into) -> Self { + self.args.push(arg.into()); + self + } + + pub fn args(mut self, args: I) -> Self + where + I: IntoIterator, + S: Into, + { + self.args.extend(args.into_iter().map(Into::into)); + self + } + + pub fn cwd(mut self, cwd: impl Into) -> Self { + self.cwd = Some(cwd.into()); + self + } + + pub fn stdin(mut self, stdin: impl Into) -> Self { + self.stdin = Some(stdin.into()); + self + } + + pub fn display(&self) -> String { + let args = self.args.join(" "); + if args.is_empty() { + self.program.clone() + } else { + format!("{} {}", self.program, args) + } + } + + pub fn run(&self) -> Result { + let mut command = Command::new(&self.program); + command.args(&self.args); + if let Some(cwd) = &self.cwd { + command.current_dir(cwd); + } + if self.stdin.is_some() { + command.stdin(Stdio::piped()); + } + + let mut child = command + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .spawn() + .with_context(|| format!("failed to start command: {}", self.display()))?; + + if let Some(stdin) = &self.stdin { + child + .stdin + .as_mut() + .context("failed to open command stdin")? + .write_all(stdin.as_bytes()) + .with_context(|| { + format!("failed to write stdin for command: {}", self.display()) + })?; + } + + let output = child + .wait_with_output() + .with_context(|| format!("failed to wait for command: {}", self.display()))?; + + Ok(CommandOutput { + code: output.status.code(), + stdout: String::from_utf8_lossy(&output.stdout).into_owned(), + stderr: String::from_utf8_lossy(&output.stderr).into_owned(), + }) + } + + pub fn spawn_background_with_log(&self, log_path: impl AsRef) -> Result { + if self.stdin.is_some() { + bail!( + "background command stdin is not supported: {}", + self.display() + ); + } + + let log = OpenOptions::new() + .create(true) + .append(true) + .open(log_path.as_ref()) + .with_context(|| format!("open command log {}", log_path.as_ref().display()))?; + let stderr = log + .try_clone() + .with_context(|| format!("clone command log {}", log_path.as_ref().display()))?; + + let mut command = Command::new(&self.program); + command.args(&self.args); + if let Some(cwd) = &self.cwd { + command.current_dir(cwd); + } + + command + .stdin(Stdio::null()) + .stdout(Stdio::from(log)) + .stderr(Stdio::from(stderr)) + .spawn() + .with_context(|| format!("failed to start background command: {}", self.display())) + } + + pub fn run_checked(&self) -> Result { + let output = self.run()?; + if output.code == Some(0) { + Ok(output) + } else { + bail!( + "command failed: {}\nexit: {:?}\nstdout:\n{}\nstderr:\n{}", + self.display(), + output.code, + output.stdout, + output.stderr + ) + } + } +} + +#[cfg(test)] +mod tests { + use super::CommandSpec; + + #[test] + fn command_display_keeps_program_and_args_visible() { + let command = CommandSpec::new("kubectl").args(["get", "pods", "-A"]); + + assert_eq!(command.display(), "kubectl get pods -A"); + } + + #[test] + fn command_display_does_not_include_stdin_payload() { + let command = CommandSpec::new("kubectl") + .args(["apply", "-f", "-"]) + .stdin("secret: value"); + + assert_eq!(command.display(), "kubectl apply -f -"); + } +} diff --git a/e2e/src/framework/config.rs b/e2e/src/framework/config.rs new file mode 100644 index 0000000..de7af80 --- /dev/null +++ b/e2e/src/framework/config.rs @@ -0,0 +1,171 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use std::path::PathBuf; +use std::time::Duration; + +pub const DEFAULT_CLUSTER_NAME: &str = "rustfs-e2e"; +pub const DEFAULT_STORAGE_HOST_DIR_PREFIX: &str = "/tmp/rustfs-e2e-storage"; +pub const DEFAULT_RUSTFS_IMAGE: &str = "rustfs/rustfs:latest"; +pub const KIND_WORKER_COUNT: usize = 3; + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct E2eConfig { + pub cluster_name: String, + pub context: String, + pub operator_namespace: String, + pub test_namespace_prefix: String, + pub test_namespace: String, + pub tenant_name: String, + pub storage_class: String, + pub pv_count: usize, + pub operator_image: String, + pub console_web_image: String, + pub rustfs_image: String, + pub kind_config: PathBuf, + pub artifacts_dir: PathBuf, + pub live_enabled: bool, + pub destructive_enabled: bool, + pub timeout: Duration, +} + +impl E2eConfig { + pub fn defaults() -> Self { + Self::from_env_with(|_| None) + } + + pub fn from_env() -> Self { + Self::from_env_with(|name| std::env::var(name).ok()) + } + + pub fn from_env_with(get_env: F) -> Self + where + F: Fn(&str) -> Option, + { + let cluster_name = DEFAULT_CLUSTER_NAME.to_string(); + let context = format!("kind-{DEFAULT_CLUSTER_NAME}"); + let test_namespace_prefix = env_or(&get_env, "RUSTFS_E2E_NAMESPACE_PREFIX", "rustfs-e2e"); + let test_namespace_default = format!("{test_namespace_prefix}-smoke"); + let test_namespace = env_or(&get_env, "RUSTFS_E2E_NAMESPACE", &test_namespace_default); + + Self { + cluster_name, + context, + operator_namespace: env_or(&get_env, "RUSTFS_E2E_OPERATOR_NAMESPACE", "rustfs-system"), + test_namespace_prefix, + test_namespace, + tenant_name: env_or(&get_env, "RUSTFS_E2E_TENANT", "e2e-tenant"), + storage_class: env_or(&get_env, "RUSTFS_E2E_STORAGE_CLASS", "local-storage"), + pv_count: env_usize(&get_env, "RUSTFS_E2E_PV_COUNT", 12), + operator_image: "rustfs/operator:e2e".to_string(), + console_web_image: "rustfs/console-web:e2e".to_string(), + rustfs_image: env_or(&get_env, "RUSTFS_E2E_SERVER_IMAGE", DEFAULT_RUSTFS_IMAGE), + kind_config: PathBuf::from(env_or( + &get_env, + "RUSTFS_E2E_KIND_CONFIG", + "e2e/manifests/kind-rustfs-e2e.yaml", + )), + artifacts_dir: PathBuf::from(env_or( + &get_env, + "RUSTFS_E2E_ARTIFACTS", + "target/e2e/artifacts", + )), + live_enabled: env_bool(&get_env, "RUSTFS_E2E_LIVE"), + destructive_enabled: env_bool(&get_env, "RUSTFS_E2E_DESTRUCTIVE"), + timeout: Duration::from_secs(env_u64(&get_env, "RUSTFS_E2E_TIMEOUT_SECONDS", 300)), + } + } + + pub fn is_dedicated_kind_context(&self, actual_context: &str) -> bool { + actual_context == self.context + } +} + +fn env_or(get_env: &F, name: &str, default: &str) -> String +where + F: Fn(&str) -> Option, +{ + get_env(name).unwrap_or_else(|| default.to_string()) +} + +fn env_bool(get_env: &F, name: &str) -> bool +where + F: Fn(&str) -> Option, +{ + get_env(name) + .map(|value| matches!(value.as_str(), "1" | "true" | "TRUE" | "yes" | "YES")) + .unwrap_or(false) +} + +fn env_u64(get_env: &F, name: &str, default: u64) -> u64 +where + F: Fn(&str) -> Option, +{ + get_env(name) + .and_then(|value| value.parse::().ok()) + .unwrap_or(default) +} + +fn env_usize(get_env: &F, name: &str, default: usize) -> usize +where + F: Fn(&str) -> Option, +{ + get_env(name) + .and_then(|value| value.parse::().ok()) + .unwrap_or(default) +} + +#[cfg(test)] +mod tests { + use super::{DEFAULT_RUSTFS_IMAGE, E2eConfig}; + + #[test] + fn default_config_uses_dedicated_kind_context() { + let config = E2eConfig::defaults(); + + assert_eq!(config.cluster_name, "rustfs-e2e"); + assert_eq!(config.context, "kind-rustfs-e2e"); + assert_eq!(config.test_namespace, "rustfs-e2e-smoke"); + assert_eq!(config.tenant_name, "e2e-tenant"); + assert_eq!(config.storage_class, "local-storage"); + assert_eq!(config.pv_count, 12); + assert_eq!(config.rustfs_image, DEFAULT_RUSTFS_IMAGE); + assert_eq!( + config.kind_config, + std::path::PathBuf::from("e2e/manifests/kind-rustfs-e2e.yaml") + ); + assert!(config.is_dedicated_kind_context("kind-rustfs-e2e")); + assert!(!config.is_dedicated_kind_context("kind-rustfs-cluster")); + } + + #[test] + fn env_overrides_do_not_change_dedicated_cluster_or_built_images() { + let config = E2eConfig::from_env_with(|name| match name { + "RUSTFS_E2E_CLUSTER" => Some("custom-e2e".to_string()), + "RUSTFS_E2E_CONTEXT" => Some("kind-custom-e2e".to_string()), + "RUSTFS_E2E_OPERATOR_IMAGE" => Some("rustfs/operator:other".to_string()), + "RUSTFS_E2E_CONSOLE_WEB_IMAGE" => Some("rustfs/console-web:other".to_string()), + "RUSTFS_E2E_SERVER_IMAGE" => Some("rustfs/rustfs:dev".to_string()), + "RUSTFS_E2E_LIVE" => Some("true".to_string()), + _ => None, + }); + + assert_eq!(config.cluster_name, "rustfs-e2e"); + assert_eq!(config.context, "kind-rustfs-e2e"); + assert_eq!(config.operator_image, "rustfs/operator:e2e"); + assert_eq!(config.console_web_image, "rustfs/console-web:e2e"); + assert_eq!(config.rustfs_image, "rustfs/rustfs:dev"); + assert!(config.live_enabled); + } +} diff --git a/e2e/src/framework/console_client.rs b/e2e/src/framework/console_client.rs new file mode 100644 index 0000000..c14ae9e --- /dev/null +++ b/e2e/src/framework/console_client.rs @@ -0,0 +1,103 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use anyhow::Result; +use reqwest::Client; +use serde::de::DeserializeOwned; +use serde_json::{Value, json}; + +#[derive(Clone)] +pub struct ConsoleClient { + base_url: String, + http: Client, +} + +impl ConsoleClient { + pub fn new(base_url: impl Into) -> Result { + let http = Client::builder().cookie_store(true).build()?; + Ok(Self { + base_url: base_url.into().trim_end_matches('/').to_string(), + http, + }) + } + + pub async fn get_text(&self, path: &str) -> Result { + Ok(self + .http + .get(self.url(path)) + .send() + .await? + .error_for_status()? + .text() + .await?) + } + + pub async fn get_json(&self, path: &str) -> Result + where + T: DeserializeOwned, + { + Ok(self + .http + .get(self.url(path)) + .send() + .await? + .error_for_status()? + .json::() + .await?) + } + + pub async fn login_with_kubernetes_token(&self, token: &str) -> Result { + Ok(self + .http + .post(self.url("/api/v1/login")) + .json(&json!({ "token": token })) + .send() + .await? + .error_for_status()? + .json::() + .await?) + } + + pub async fn logout(&self) -> Result { + Ok(self + .http + .post(self.url("/api/v1/logout")) + .send() + .await? + .error_for_status()? + .json::() + .await?) + } + + fn url(&self, path: &str) -> String { + if path.starts_with('/') { + format!("{}{}", self.base_url, path) + } else { + format!("{}/{}", self.base_url, path) + } + } +} + +#[cfg(test)] +mod tests { + use super::ConsoleClient; + + #[test] + fn client_normalizes_base_url_without_trailing_slash() { + let client = ConsoleClient::new("http://127.0.0.1:9090/").expect("client builds"); + + assert_eq!(client.url("/healthz"), "http://127.0.0.1:9090/healthz"); + assert_eq!(client.url("readyz"), "http://127.0.0.1:9090/readyz"); + } +} diff --git a/e2e/src/framework/deploy.rs b/e2e/src/framework/deploy.rs new file mode 100644 index 0000000..b04e8f9 --- /dev/null +++ b/e2e/src/framework/deploy.rs @@ -0,0 +1,181 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use anyhow::Result; + +use crate::framework::{config::E2eConfig, kubectl::Kubectl, resources}; + +const CONTROL_PLANE_CRD: &str = + include_str!("../../../deploy/rustfs-operator/crds/tenant-crd.yaml"); +const OPERATOR_RBAC: &str = include_str!("../../../deploy/k8s-dev/operator-rbac.yaml"); +const CONSOLE_RBAC: &str = include_str!("../../../deploy/k8s-dev/console-rbac.yaml"); +const OPERATOR_DEPLOYMENT: &str = include_str!("../../../deploy/k8s-dev/operator-deployment.yaml"); +const CONSOLE_DEPLOYMENT: &str = include_str!("../../../deploy/k8s-dev/console-deployment.yaml"); +const CONSOLE_SERVICE: &str = include_str!("../../../deploy/k8s-dev/console-service.yaml"); +const CONSOLE_FRONTEND_DEPLOYMENT: &str = + include_str!("../../../deploy/k8s-dev/console-frontend-deployment.yaml"); +const CONSOLE_FRONTEND_SERVICE: &str = + include_str!("../../../deploy/k8s-dev/console-frontend-service.yaml"); + +const CONSOLE_JWT_SECRET_NAME: &str = "rustfs-operator-console-secret"; +const E2E_OPERATOR_IMAGE_TAG_DEFAULT: &str = "rustfs/operator:dev"; +const E2E_CONSOLE_WEB_IMAGE_TAG_DEFAULT: &str = "rustfs/console-web:dev"; +const E2E_CONTROL_PLANE_DEPLOYMENTS: [&str; 3] = [ + "rustfs-operator", + "rustfs-operator-console", + "rustfs-operator-console-frontend", +]; +const CONTROL_PLANE_ROLLOUT_TIMEOUT: &str = "180s"; + +pub fn deploy_dev(config: &E2eConfig) -> Result<()> { + let kubectl = Kubectl::new(config); + + kubectl + .apply_yaml_command(resources::namespace_manifest(&config.operator_namespace)) + .run_checked()?; + + kubectl + .apply_yaml_command(CONTROL_PLANE_CRD) + .run_checked()?; + + kubectl + .apply_yaml_command(ensure_console_jwt_secret(config)) + .run_checked()?; + + kubectl.apply_yaml_command(OPERATOR_RBAC).run_checked()?; + kubectl.apply_yaml_command(CONSOLE_RBAC).run_checked()?; + + kubectl + .apply_yaml_command(patch_images_and_tags( + OPERATOR_DEPLOYMENT, + &config.operator_image, + E2E_OPERATOR_IMAGE_TAG_DEFAULT, + )) + .run_checked()?; + kubectl + .apply_yaml_command(patch_images_and_tags( + CONSOLE_DEPLOYMENT, + &config.operator_image, + E2E_OPERATOR_IMAGE_TAG_DEFAULT, + )) + .run_checked()?; + kubectl.apply_yaml_command(CONSOLE_SERVICE).run_checked()?; + kubectl + .apply_yaml_command(patch_images_and_tags( + CONSOLE_FRONTEND_DEPLOYMENT, + &config.console_web_image, + E2E_CONSOLE_WEB_IMAGE_TAG_DEFAULT, + )) + .run_checked()?; + kubectl + .apply_yaml_command(CONSOLE_FRONTEND_SERVICE) + .run_checked()?; + + Ok(()) +} + +pub fn rollout_dev(config: &E2eConfig) -> Result<()> { + let kubectl = Kubectl::new(config).namespaced(&config.operator_namespace); + + kubectl + .command( + ["rollout", "restart", "deployment"] + .into_iter() + .chain(E2E_CONTROL_PLANE_DEPLOYMENTS), + ) + .run_checked()?; + + wait_control_plane_rollout(config) +} + +pub fn wait_control_plane_rollout(config: &E2eConfig) -> Result<()> { + let kubectl = Kubectl::new(config).namespaced(&config.operator_namespace); + + for deployment in E2E_CONTROL_PLANE_DEPLOYMENTS { + kubectl + .command([ + "rollout".to_string(), + "status".to_string(), + format!("deployment/{deployment}"), + format!("--timeout={CONTROL_PLANE_ROLLOUT_TIMEOUT}"), + ]) + .run_checked()?; + } + + Ok(()) +} + +fn ensure_console_jwt_secret(config: &E2eConfig) -> String { + format!( + r#"apiVersion: v1 +kind: Secret +metadata: + name: {secret} + namespace: {namespace} +type: Opaque +stringData: + jwt-secret: {jwt} +"#, + secret = CONSOLE_JWT_SECRET_NAME, + namespace = config.operator_namespace, + jwt = "rustfs-e2e-jwt-secret", + ) +} + +fn patch_images_and_tags(manifest: &str, image: &str, fallback: &str) -> String { + if image == fallback { + manifest.to_string() + } else { + manifest.replace(fallback, image) + } +} + +#[cfg(test)] +mod tests { + use super::{ + E2E_CONSOLE_WEB_IMAGE_TAG_DEFAULT, E2E_CONTROL_PLANE_DEPLOYMENTS, + E2E_OPERATOR_IMAGE_TAG_DEFAULT, patch_images_and_tags, + }; + + #[test] + fn patch_images_prefers_explicit_runtime_image_tags() { + let operator = patch_images_and_tags( + "image: rustfs/operator:dev\nimagePullPolicy: Never\n", + "rustfs/operator:e2e", + E2E_OPERATOR_IMAGE_TAG_DEFAULT, + ); + let web = patch_images_and_tags( + "image: rustfs/console-web:dev\n", + "rustfs/console-web:e2e", + E2E_CONSOLE_WEB_IMAGE_TAG_DEFAULT, + ); + + assert!(operator.contains("image: rustfs/operator:e2e")); + assert!(!operator.contains(E2E_OPERATOR_IMAGE_TAG_DEFAULT)); + assert!(web.contains("image: rustfs/console-web:e2e")); + assert!(!web.contains(E2E_CONSOLE_WEB_IMAGE_TAG_DEFAULT)); + } + + #[test] + fn rollout_deployments_are_explicit_and_stable() { + assert_eq!( + E2E_CONTROL_PLANE_DEPLOYMENTS, + [ + "rustfs-operator", + "rustfs-operator-console", + "rustfs-operator-console-frontend", + ] + ); + } +} diff --git a/e2e/src/framework/images.rs b/e2e/src/framework/images.rs new file mode 100644 index 0000000..8e91c28 --- /dev/null +++ b/e2e/src/framework/images.rs @@ -0,0 +1,56 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use crate::framework::config::E2eConfig; + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct ImageSet { + pub operator: String, + pub console_web: String, + pub rustfs: String, +} + +impl ImageSet { + pub fn from_config(config: &E2eConfig) -> Self { + Self { + operator: config.operator_image.clone(), + console_web: config.console_web_image.clone(), + rustfs: config.rustfs_image.clone(), + } + } + + pub fn all(&self) -> [&str; 3] { + [&self.operator, &self.console_web, &self.rustfs] + } +} + +#[cfg(test)] +mod tests { + use super::ImageSet; + use crate::framework::config::E2eConfig; + + #[test] + fn image_set_tracks_operator_console_and_server_images() { + let images = ImageSet::from_config(&E2eConfig::defaults()); + + assert_eq!( + images.all(), + [ + "rustfs/operator:e2e", + "rustfs/console-web:e2e", + "rustfs/rustfs:latest" + ] + ); + } +} diff --git a/e2e/src/framework/kind.rs b/e2e/src/framework/kind.rs new file mode 100644 index 0000000..b717158 --- /dev/null +++ b/e2e/src/framework/kind.rs @@ -0,0 +1,251 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use anyhow::{Context, Result, bail}; +use std::fs; +use std::os::unix::fs::MetadataExt; +use std::path::{Path, PathBuf}; + +use crate::framework::{ + command::CommandSpec, + config::{DEFAULT_STORAGE_HOST_DIR_PREFIX, E2eConfig, KIND_WORKER_COUNT}, +}; + +#[derive(Debug, Clone)] +pub struct KindCluster { + config: E2eConfig, +} + +impl KindCluster { + pub fn new(config: E2eConfig) -> Self { + Self { config } + } + + pub fn create_command(&self) -> CommandSpec { + CommandSpec::new("kind").args([ + "create".to_string(), + "cluster".to_string(), + "--name".to_string(), + self.config.cluster_name.clone(), + "--config".to_string(), + self.config.kind_config.display().to_string(), + ]) + } + + pub fn host_storage_dirs(&self) -> Vec { + (1..=KIND_WORKER_COUNT) + .map(|index| PathBuf::from(format!("{}-{index}", DEFAULT_STORAGE_HOST_DIR_PREFIX))) + .collect() + } + + pub fn reset_host_storage_dirs(&self) -> Result<()> { + for dir in self.host_storage_dirs() { + ensure_dedicated_host_storage_dir(&dir)?; + if fs::symlink_metadata(&dir).is_ok() { + self.remove_host_storage_dir(&dir)?; + } + fs::create_dir_all(&dir) + .with_context(|| format!("create e2e host storage dir {}", dir.display()))?; + } + Ok(()) + } + + pub fn cleanup_host_storage_dirs(&self) -> Result<()> { + for dir in self.host_storage_dirs() { + ensure_dedicated_host_storage_dir(&dir)?; + if fs::symlink_metadata(&dir).is_ok() { + self.remove_host_storage_dir(&dir)?; + } + } + Ok(()) + } + + fn remove_host_storage_dir(&self, dir: &Path) -> Result<()> { + ensure_existing_dedicated_host_storage_dir_is_safe(dir)?; + println!("removing dedicated e2e storage dir {}", dir.display()); + + match fs::remove_dir_all(dir) { + Ok(()) => Ok(()), + Err(error) => { + println!( + "direct removal failed for {}: {error}; retrying through Docker helper as root", + dir.display() + ); + self.docker_clean_host_storage_command(dir)?.run_checked()?; + fs::remove_dir_all(dir).with_context(|| { + format!("remove dedicated e2e host storage dir {}", dir.display()) + }) + } + } + } + + fn docker_clean_host_storage_command(&self, dir: &Path) -> Result { + ensure_dedicated_host_storage_dir(dir)?; + + Ok(CommandSpec::new("docker").args([ + "run".to_string(), + "--rm".to_string(), + "--pull".to_string(), + "never".to_string(), + "--entrypoint".to_string(), + "/bin/sh".to_string(), + "-v".to_string(), + format!("{}:/e2e-storage", dir.display()), + self.config.operator_image.clone(), + "-c".to_string(), + "find /e2e-storage -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +".to_string(), + ])) + } + + pub fn delete_command(&self) -> CommandSpec { + CommandSpec::new("kind").args([ + "delete".to_string(), + "cluster".to_string(), + "--name".to_string(), + self.config.cluster_name.clone(), + ]) + } + + pub fn load_image_command(&self, image: &str) -> CommandSpec { + CommandSpec::new("kind").args([ + "load".to_string(), + "docker-image".to_string(), + image.to_string(), + "--name".to_string(), + self.config.cluster_name.clone(), + ]) + } +} + +fn ensure_existing_dedicated_host_storage_dir_is_safe(path: &Path) -> Result<()> { + ensure_dedicated_host_storage_dir(path)?; + let metadata = fs::symlink_metadata(path) + .with_context(|| format!("inspect e2e host storage dir {}", path.display()))?; + + if metadata.file_type().is_symlink() { + bail!( + "refusing to remove symlinked e2e host storage dir: {}", + path.display() + ); + } + + if !metadata.is_dir() { + bail!( + "refusing to remove non-directory e2e host storage path: {}", + path.display() + ); + } + + let current_uid = current_uid()?; + if metadata.uid() != current_uid { + bail!( + "refusing Docker-root cleanup for e2e host storage dir {} owned by uid {}; current uid is {}", + path.display(), + metadata.uid(), + current_uid + ); + } + + Ok(()) +} + +fn ensure_dedicated_host_storage_dir(path: &Path) -> Result<()> { + let is_allowed = (1..=KIND_WORKER_COUNT) + .any(|index| path == Path::new(&format!("{}-{index}", DEFAULT_STORAGE_HOST_DIR_PREFIX))); + + if is_allowed { + return Ok(()); + } + + bail!( + "refusing to remove non-dedicated e2e host storage dir: {}", + path.display() + ) +} + +fn current_uid() -> Result { + let output = CommandSpec::new("id").arg("-u").run_checked()?; + output + .stdout + .trim() + .parse::() + .context("parse current uid from `id -u`") +} + +#[cfg(test)] +mod tests { + use super::{KindCluster, ensure_dedicated_host_storage_dir}; + use crate::framework::config::E2eConfig; + + #[test] + fn load_image_command_targets_the_dedicated_cluster() { + let kind = KindCluster::new(E2eConfig::defaults()); + let command = kind.load_image_command("rustfs/operator:e2e"); + + assert_eq!( + command.display(), + "kind load docker-image rustfs/operator:e2e --name rustfs-e2e" + ); + } + + #[test] + fn host_storage_dirs_use_e2e_prefix() { + let kind = KindCluster::new(E2eConfig::defaults()); + + assert_eq!( + kind.host_storage_dirs(), + vec![ + std::path::PathBuf::from("/tmp/rustfs-e2e-storage-1"), + std::path::PathBuf::from("/tmp/rustfs-e2e-storage-2"), + std::path::PathBuf::from("/tmp/rustfs-e2e-storage-3"), + ] + ); + } + + #[test] + fn host_storage_cleanup_only_allows_dedicated_tmp_dirs() { + assert!( + ensure_dedicated_host_storage_dir(std::path::Path::new("/tmp/rustfs-e2e-storage-1")) + .is_ok() + ); + assert!(ensure_dedicated_host_storage_dir(std::path::Path::new("/tmp/other")).is_err()); + assert!( + ensure_dedicated_host_storage_dir(std::path::Path::new("/tmp/rustfs-e2e-storage-99")) + .is_err() + ); + assert!( + ensure_dedicated_host_storage_dir(std::path::Path::new( + "/var/tmp/rustfs-e2e-storage-1" + )) + .is_err() + ); + } + + #[test] + fn docker_cleanup_command_mounts_only_dedicated_storage_dir() { + let kind = KindCluster::new(E2eConfig::defaults()); + let command = kind + .docker_clean_host_storage_command(std::path::Path::new("/tmp/rustfs-e2e-storage-1")) + .expect("dedicated storage dir should be accepted"); + + assert_eq!( + command.display(), + "docker run --rm --pull never --entrypoint /bin/sh -v /tmp/rustfs-e2e-storage-1:/e2e-storage rustfs/operator:e2e -c find /e2e-storage -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +" + ); + assert!( + kind.docker_clean_host_storage_command(std::path::Path::new("/tmp/other")) + .is_err() + ); + } +} diff --git a/e2e/src/framework/kube_client.rs b/e2e/src/framework/kube_client.rs new file mode 100644 index 0000000..881b542 --- /dev/null +++ b/e2e/src/framework/kube_client.rs @@ -0,0 +1,25 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use anyhow::Result; +use kube::{Api, Client}; +use operator::types::v1alpha1::tenant::Tenant; + +pub async fn default_client() -> Result { + Ok(Client::try_default().await?) +} + +pub fn tenant_api(client: Client, namespace: &str) -> Api { + Api::namespaced(client, namespace) +} diff --git a/e2e/src/framework/kubectl.rs b/e2e/src/framework/kubectl.rs new file mode 100644 index 0000000..9ab45c3 --- /dev/null +++ b/e2e/src/framework/kubectl.rs @@ -0,0 +1,81 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use crate::framework::{command::CommandSpec, config::E2eConfig}; + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct Kubectl { + context: String, + namespace: Option, +} + +impl Kubectl { + pub fn new(config: &E2eConfig) -> Self { + Self { + context: config.context.clone(), + namespace: None, + } + } + + pub fn namespaced(mut self, namespace: impl Into) -> Self { + self.namespace = Some(namespace.into()); + self + } + + pub fn command(&self, args: I) -> CommandSpec + where + I: IntoIterator, + S: Into, + { + let mut kubectl_args = vec!["--context".to_string(), self.context.clone()]; + if let Some(namespace) = &self.namespace { + kubectl_args.push("-n".to_string()); + kubectl_args.push(namespace.clone()); + } + kubectl_args.extend(args.into_iter().map(Into::into)); + CommandSpec::new("kubectl").args(kubectl_args) + } + + pub fn apply_yaml_command(&self, yaml: impl Into) -> CommandSpec { + self.command(["apply", "-f", "-"]).stdin(yaml) + } +} + +#[cfg(test)] +mod tests { + use super::Kubectl; + use crate::framework::config::E2eConfig; + + #[test] + fn kubectl_commands_pin_the_expected_context() { + let kubectl = Kubectl::new(&E2eConfig::defaults()).namespaced("rustfs-system"); + let command = kubectl.command(["get", "pods"]); + + assert_eq!( + command.display(), + "kubectl --context kind-rustfs-e2e -n rustfs-system get pods" + ); + } + + #[test] + fn kubectl_apply_yaml_uses_stdin_without_exposing_payload() { + let kubectl = Kubectl::new(&E2eConfig::defaults()); + let command = kubectl.apply_yaml_command("kind: Namespace"); + + assert_eq!( + command.display(), + "kubectl --context kind-rustfs-e2e apply -f -" + ); + } +} diff --git a/e2e/src/framework/live.rs b/e2e/src/framework/live.rs new file mode 100644 index 0000000..4c2e9bd --- /dev/null +++ b/e2e/src/framework/live.rs @@ -0,0 +1,64 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use anyhow::{Result, ensure}; + +use crate::framework::{command::CommandSpec, config::E2eConfig}; + +pub fn require_live_enabled(config: &E2eConfig) -> Result<()> { + ensure!( + config.live_enabled, + "live e2e is disabled; set RUSTFS_E2E_LIVE=1 to run cluster-backed tests" + ); + Ok(()) +} + +pub fn require_destructive_enabled(config: &E2eConfig) -> Result<()> { + ensure!( + config.destructive_enabled, + "destructive e2e faults are disabled; set RUSTFS_E2E_DESTRUCTIVE=1 explicitly" + ); + Ok(()) +} + +pub fn current_context() -> Result { + let output = CommandSpec::new("kubectl") + .args(["config", "current-context"]) + .run_checked()?; + Ok(output.stdout.trim().to_string()) +} + +pub fn ensure_dedicated_context(config: &E2eConfig) -> Result { + let actual = current_context()?; + ensure!( + config.is_dedicated_kind_context(&actual), + "refusing to run e2e against context {actual:?}; expected dedicated kind context {:?}", + config.context + ); + Ok(actual) +} + +#[cfg(test)] +mod tests { + use super::{require_destructive_enabled, require_live_enabled}; + use crate::framework::config::E2eConfig; + + #[test] + fn live_and_destructive_guards_are_disabled_by_default() { + let config = E2eConfig::defaults(); + + assert!(require_live_enabled(&config).is_err()); + assert!(require_destructive_enabled(&config).is_err()); + } +} diff --git a/e2e/src/framework/mod.rs b/e2e/src/framework/mod.rs new file mode 100644 index 0000000..fe443bf --- /dev/null +++ b/e2e/src/framework/mod.rs @@ -0,0 +1,33 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +pub mod artifacts; +pub mod assertions; +pub mod command; +pub mod config; +pub mod console_client; +pub mod deploy; +pub mod images; +pub mod kind; +pub mod kube_client; +pub mod kubectl; +pub mod live; +pub mod port_forward; +pub mod resources; +pub mod storage; +pub mod tenant_factory; +pub mod tools; +pub mod wait; + +pub use config::E2eConfig; diff --git a/e2e/src/framework/port_forward.rs b/e2e/src/framework/port_forward.rs new file mode 100644 index 0000000..347ea87 --- /dev/null +++ b/e2e/src/framework/port_forward.rs @@ -0,0 +1,141 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use anyhow::{Context, Result, bail}; +use std::fs; +use std::path::{Path, PathBuf}; +use std::process::Child; +use uuid::Uuid; + +use crate::framework::{command::CommandSpec, config::E2eConfig, kubectl::Kubectl}; + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct PortForwardSpec { + pub namespace: String, + pub service: String, + pub local_port: u16, + pub remote_port: u16, +} + +#[derive(Debug)] +pub struct PortForwardGuard { + child: Child, + log_path: PathBuf, + command_display: String, +} + +impl PortForwardSpec { + pub fn console(namespace: impl Into) -> Self { + Self { + namespace: namespace.into(), + service: "svc/rustfs-operator-console".to_string(), + local_port: 19090, + remote_port: 9090, + } + } + + pub fn command(&self, kubectl: &Kubectl) -> CommandSpec { + kubectl.clone().namespaced(&self.namespace).command([ + "port-forward".to_string(), + self.service.clone(), + format!("{}:{}", self.local_port, self.remote_port), + ]) + } + + pub fn start( + &self, + kubectl: &Kubectl, + log_path: impl Into, + ) -> Result { + let log_path = log_path.into(); + let command = self.command(kubectl); + let child = command.spawn_background_with_log(&log_path)?; + Ok(PortForwardGuard { + child, + log_path, + command_display: command.display(), + }) + } + + pub fn start_with_temp_log(&self, kubectl: &Kubectl) -> Result { + let log_path = + std::env::temp_dir().join(format!("e2e-port-forward-{}.log", Uuid::new_v4())); + self.start(kubectl, log_path) + } + + pub fn local_base_url(&self) -> String { + format!("http://127.0.0.1:{}", self.local_port) + } + + pub fn start_console(config: &E2eConfig) -> Result { + let kubectl = Kubectl::new(config); + Self::console(&config.operator_namespace).start_with_temp_log(&kubectl) + } +} + +impl PortForwardGuard { + pub fn log_path(&self) -> &Path { + &self.log_path + } + + pub fn command_display(&self) -> &str { + &self.command_display + } + + pub fn ensure_running(&mut self) -> Result<()> { + if let Some(status) = self + .child + .try_wait() + .with_context(|| format!("check port-forward process: {}", self.command_display))? + { + bail!( + "port-forward exited early with {status}; command: {}; log {}:\n{}", + self.command_display, + self.log_path.display(), + self.log_contents() + ); + } + Ok(()) + } + + pub fn log_contents(&self) -> String { + fs::read_to_string(&self.log_path).unwrap_or_else(|_| "".to_string()) + } +} + +impl Drop for PortForwardGuard { + fn drop(&mut self) { + if self.child.try_wait().ok().flatten().is_none() { + let _ = self.child.kill(); + let _ = self.child.wait(); + } + } +} + +#[cfg(test)] +mod tests { + use super::PortForwardSpec; + use crate::framework::{config::E2eConfig, kubectl::Kubectl}; + + #[test] + fn console_port_forward_targets_operator_console_service() { + let kubectl = Kubectl::new(&E2eConfig::defaults()); + let command = PortForwardSpec::console("rustfs-system").command(&kubectl); + + assert_eq!( + command.display(), + "kubectl --context kind-rustfs-e2e -n rustfs-system port-forward svc/rustfs-operator-console 19090:9090" + ); + } +} diff --git a/e2e/src/framework/resources.rs b/e2e/src/framework/resources.rs new file mode 100644 index 0000000..c0e91bc --- /dev/null +++ b/e2e/src/framework/resources.rs @@ -0,0 +1,112 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use anyhow::Result; + +use crate::framework::{config::E2eConfig, kubectl::Kubectl, tenant_factory::TenantTemplate}; + +const E2E_ACCESS_KEY: &str = "e2eaccess"; +const E2E_SECRET_KEY: &str = "e2esecret"; + +pub fn credential_secret_name(config: &E2eConfig) -> String { + format!("{}-credentials", config.tenant_name) +} + +pub fn namespace_manifest(namespace: &str) -> String { + format!( + r#"apiVersion: v1 +kind: Namespace +metadata: + name: {namespace} +"# + ) +} + +pub fn credential_secret_manifest(config: &E2eConfig) -> String { + format!( + r#"apiVersion: v1 +kind: Secret +metadata: + name: {secret_name} + namespace: {namespace} +type: Opaque +stringData: + accesskey: {access_key} + secretkey: {secret_key} +"#, + secret_name = credential_secret_name(config), + namespace = config.test_namespace, + access_key = E2E_ACCESS_KEY, + secret_key = E2E_SECRET_KEY + ) +} + +pub fn smoke_tenant_template(config: &E2eConfig) -> TenantTemplate { + TenantTemplate::kind_local( + &config.test_namespace, + &config.tenant_name, + &config.rustfs_image, + &config.storage_class, + credential_secret_name(config), + ) +} + +pub fn smoke_tenant_manifest(config: &E2eConfig) -> Result { + Ok(serde_yaml_ng::to_string( + &smoke_tenant_template(config).build(), + )?) +} + +pub fn apply_smoke_tenant_resources(config: &E2eConfig) -> Result<()> { + let kubectl = Kubectl::new(config); + kubectl + .apply_yaml_command(namespace_manifest(&config.test_namespace)) + .run_checked()?; + kubectl + .apply_yaml_command(credential_secret_manifest(config)) + .run_checked()?; + kubectl + .apply_yaml_command(smoke_tenant_manifest(config)?) + .run_checked()?; + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::{credential_secret_manifest, credential_secret_name, smoke_tenant_manifest}; + use crate::framework::config::E2eConfig; + + #[test] + fn smoke_tenant_manifest_wires_secret_storage_and_image() { + let config = E2eConfig::defaults(); + let manifest = smoke_tenant_manifest(&config).expect("tenant manifest"); + + assert!(manifest.contains("kind: Tenant")); + assert!(manifest.contains("namespace: rustfs-e2e-smoke")); + assert!(manifest.contains("image: rustfs/rustfs:latest")); + assert!(manifest.contains("storageClassName: local-storage")); + assert!(manifest.contains("name: e2e-tenant-credentials")); + } + + #[test] + fn credential_secret_uses_e2e_tenant_scope() { + let config = E2eConfig::defaults(); + let manifest = credential_secret_manifest(&config); + + assert_eq!(credential_secret_name(&config), "e2e-tenant-credentials"); + assert!(manifest.contains("namespace: rustfs-e2e-smoke")); + assert!(manifest.contains("accesskey:")); + assert!(manifest.contains("secretkey:")); + } +} diff --git a/e2e/src/framework/storage.rs b/e2e/src/framework/storage.rs new file mode 100644 index 0000000..8bd5e89 --- /dev/null +++ b/e2e/src/framework/storage.rs @@ -0,0 +1,165 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use anyhow::Result; + +use crate::framework::{ + command::CommandSpec, + config::{E2eConfig, KIND_WORKER_COUNT}, + kubectl::Kubectl, +}; + +pub const RUSTFS_RUN_AS_UID: u32 = 10001; + +pub fn worker_node_names(config: &E2eConfig) -> Vec { + (1..=KIND_WORKER_COUNT) + .map(|index| match index { + 1 => format!("{}-worker", config.cluster_name), + _ => format!("{}-worker{index}", config.cluster_name), + }) + .collect() +} + +pub fn volume_path(index: usize) -> String { + format!("/mnt/data/vol{index}") +} + +pub fn volume_directory_commands(config: &E2eConfig) -> Vec { + let mut commands = Vec::new(); + for node in worker_node_names(config) { + for index in 1..=config.pv_count { + let path = volume_path(index); + commands.push(CommandSpec::new("docker").args([ + "exec".to_string(), + node.clone(), + "mkdir".to_string(), + "-p".to_string(), + path.clone(), + ])); + commands.push(CommandSpec::new("docker").args([ + "exec".to_string(), + node.clone(), + "chown".to_string(), + "-R".to_string(), + format!("{uid}:{uid}", uid = RUSTFS_RUN_AS_UID), + path, + ])); + } + } + commands +} + +pub fn local_storage_manifest(config: &E2eConfig) -> String { + let mut manifest = format!( + r#"--- +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: {storage_class} +provisioner: kubernetes.io/no-provisioner +volumeBindingMode: WaitForFirstConsumer +"#, + storage_class = config.storage_class + ); + + for index in 1..=config.pv_count { + let worker_group = ((index - 1) % KIND_WORKER_COUNT) + 1; + manifest.push_str(&format!( + r#"--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: {cluster}-pv-{index} +spec: + capacity: + storage: 10Gi + volumeMode: Filesystem + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + storageClassName: {storage_class} + local: + path: {path} + nodeAffinity: + required: + nodeSelectorTerms: + - matchExpressions: + - key: worker-group + operator: In + values: + - storage-{worker_group} +"#, + cluster = config.cluster_name, + index = index, + storage_class = config.storage_class, + path = volume_path(index), + worker_group = worker_group + )); + } + + manifest +} + +pub fn prepare_local_storage(config: &E2eConfig) -> Result<()> { + for command in volume_directory_commands(config) { + command.run_checked()?; + } + + Kubectl::new(config) + .apply_yaml_command(local_storage_manifest(config)) + .run_checked()?; + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::{local_storage_manifest, volume_directory_commands, worker_node_names}; + use crate::framework::config::E2eConfig; + + #[test] + fn local_storage_manifest_uses_configured_class_and_pv_count() { + let config = E2eConfig::defaults(); + let manifest = local_storage_manifest(&config); + + assert!(manifest.contains("name: local-storage")); + assert_eq!( + manifest.matches("kind: PersistentVolume").count(), + config.pv_count + ); + assert!(manifest.contains("storage-1")); + assert!(manifest.contains("storage-2")); + assert!(manifest.contains("storage-3")); + } + + #[test] + fn storage_volume_commands_target_dedicated_workers() { + let config = E2eConfig::defaults(); + + assert_eq!( + worker_node_names(&config), + vec![ + "rustfs-e2e-worker".to_string(), + "rustfs-e2e-worker2".to_string(), + "rustfs-e2e-worker3".to_string(), + ] + ); + assert!( + volume_directory_commands(&config) + .first() + .expect("at least one command") + .display() + .contains("docker exec rustfs-e2e-worker mkdir -p /mnt/data/vol1") + ); + } +} diff --git a/e2e/src/framework/tenant_factory.rs b/e2e/src/framework/tenant_factory.rs new file mode 100644 index 0000000..9933046 --- /dev/null +++ b/e2e/src/framework/tenant_factory.rs @@ -0,0 +1,162 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use k8s_openapi::api::core::v1::{ + EnvVar, LocalObjectReference, PersistentVolumeClaimSpec, VolumeResourceRequirements, +}; +use k8s_openapi::apimachinery::pkg::api::resource::Quantity; +use operator::types::v1alpha1::k8s::ImagePullPolicy; +use operator::types::v1alpha1::persistence::PersistenceConfig; +use operator::types::v1alpha1::pool::{Pool, SchedulingConfig}; +use operator::types::v1alpha1::tenant::{Tenant, TenantSpec}; +use std::collections::BTreeMap; + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct TenantTemplate { + pub namespace: String, + pub name: String, + pub image: String, + pub storage_class: String, + pub credential_secret_name: String, + pub servers: i32, + pub volumes_per_server: i32, + pub unsafe_bypass_disk_check: bool, +} + +impl TenantTemplate { + pub fn kind_local( + namespace: impl Into, + name: impl Into, + image: impl Into, + storage_class: impl Into, + credential_secret_name: impl Into, + ) -> Self { + Self { + namespace: namespace.into(), + name: name.into(), + image: image.into(), + storage_class: storage_class.into(), + credential_secret_name: credential_secret_name.into(), + servers: 4, + volumes_per_server: 2, + unsafe_bypass_disk_check: true, + } + } + + pub fn build(&self) -> Tenant { + let pool = Pool { + name: "primary".to_string(), + servers: self.servers, + persistence: PersistenceConfig { + volumes_per_server: self.volumes_per_server, + volume_claim_template: Some(PersistentVolumeClaimSpec { + access_modes: Some(vec!["ReadWriteOnce".to_string()]), + resources: Some(VolumeResourceRequirements { + requests: Some( + [("storage".to_string(), Quantity("10Gi".to_string()))] + .into_iter() + .collect(), + ), + ..Default::default() + }), + storage_class_name: Some(self.storage_class.clone()), + ..Default::default() + }), + ..PersistenceConfig::default() + }, + scheduling: SchedulingConfig { + node_selector: Some( + [("rustfs-storage".to_string(), "true".to_string())] + .into_iter() + .collect::>(), + ), + ..SchedulingConfig::default() + }, + }; + + let mut env = vec![EnvVar { + name: "RUST_LOG".to_string(), + value: Some("info".to_string()), + ..EnvVar::default() + }]; + + if self.unsafe_bypass_disk_check { + env.push(EnvVar { + name: "RUSTFS_UNSAFE_BYPASS_DISK_CHECK".to_string(), + value: Some("true".to_string()), + ..EnvVar::default() + }); + } + + let spec = TenantSpec { + pools: vec![pool], + image: Some(self.image.clone()), + image_pull_policy: Some(ImagePullPolicy::IfNotPresent), + creds_secret: Some(LocalObjectReference { + name: self.credential_secret_name.clone(), + }), + env, + ..TenantSpec::default() + }; + + let mut tenant = Tenant::new(&self.name, spec); + tenant.metadata.namespace = Some(self.namespace.clone()); + tenant + } +} + +#[cfg(test)] +mod tests { + use super::TenantTemplate; + + #[test] + fn kind_local_tenant_uses_local_image_policy_and_disk_bypass() { + let tenant = TenantTemplate::kind_local( + "rustfs-e2e", + "tenant-a", + "rustfs/rustfs:e2e", + "local-storage", + "tenant-a-credentials", + ) + .build(); + + assert_eq!(tenant.metadata.namespace.as_deref(), Some("rustfs-e2e")); + assert_eq!(tenant.spec.image.as_deref(), Some("rustfs/rustfs:e2e")); + assert_eq!( + tenant + .spec + .creds_secret + .as_ref() + .map(|secret| secret.name.as_str()), + Some("tenant-a-credentials") + ); + assert_eq!( + tenant.spec.pools[0] + .persistence + .volume_claim_template + .as_ref() + .and_then(|claim| claim.storage_class_name.as_deref()), + Some("local-storage") + ); + assert!(tenant.spec.image_pull_policy.is_some()); + assert!( + tenant + .spec + .env + .iter() + .any(|env| env.name == "RUSTFS_UNSAFE_BYPASS_DISK_CHECK" + && env.value.as_deref() == Some("true")) + ); + } +} diff --git a/e2e/src/framework/tools.rs b/e2e/src/framework/tools.rs new file mode 100644 index 0000000..5c66dbe --- /dev/null +++ b/e2e/src/framework/tools.rs @@ -0,0 +1,60 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use crate::framework::command::CommandSpec; + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct ToolCheck { + pub name: &'static str, + pub command: CommandSpec, +} + +pub fn required_tool_checks() -> Vec { + vec![ + ToolCheck { + name: "cargo", + command: CommandSpec::new("cargo").arg("--version"), + }, + ToolCheck { + name: "kind", + command: CommandSpec::new("kind").arg("version"), + }, + ToolCheck { + name: "kubectl", + command: CommandSpec::new("kubectl").args(["version", "--client"]), + }, + ToolCheck { + name: "docker", + command: CommandSpec::new("docker").arg("version"), + }, + ] +} + +#[cfg(test)] +mod tests { + use super::required_tool_checks; + + #[test] + fn required_tool_inventory_covers_live_e2e_dependencies() { + let tools = required_tool_checks() + .into_iter() + .map(|check| check.name) + .collect::>(); + + assert!(tools.contains(&"cargo")); + assert!(tools.contains(&"kind")); + assert!(tools.contains(&"kubectl")); + assert!(tools.contains(&"docker")); + } +} diff --git a/e2e/src/framework/wait.rs b/e2e/src/framework/wait.rs new file mode 100644 index 0000000..4bff49e --- /dev/null +++ b/e2e/src/framework/wait.rs @@ -0,0 +1,113 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use anyhow::{Result, bail}; +use kube::Api; +use operator::types::v1alpha1::tenant::Tenant; +use std::future::Future; +use std::time::{Duration, Instant}; +use tokio::time::sleep; + +use crate::framework::assertions; + +pub async fn wait_until( + description: &str, + timeout: Duration, + interval: Duration, + mut probe: F, +) -> Result +where + F: FnMut() -> Fut, + Fut: Future>>, +{ + let start = Instant::now(); + loop { + if let Some(value) = probe().await? { + return Ok(value); + } + + if start.elapsed() >= timeout { + bail!("timed out waiting for {description} after {timeout:?}"); + } + + sleep(interval).await; + } +} + +pub async fn wait_for_tenant_ready( + tenants: Api, + name: &str, + timeout: Duration, +) -> Result { + let name = name.to_string(); + wait_until( + &format!("Tenant {name} to become Ready"), + timeout, + Duration::from_secs(5), + move || { + let tenants = tenants.clone(); + let name = name.clone(); + async move { + let tenant = tenants.get(&name).await?; + if assertions::current_state(&tenant) == Some("Ready") + && assertions::condition_status(&tenant, "Ready") == Some("True") + && assertions::condition_status(&tenant, "Degraded") == Some("False") + && assertions::require_observed_generation_current(&tenant).is_ok() + { + Ok(Some(tenant)) + } else { + Ok(None) + } + } + }, + ) + .await +} + +#[cfg(test)] +mod tests { + use super::wait_until; + use std::sync::{Arc, Mutex}; + use std::time::Duration; + + #[tokio::test] + async fn wait_until_returns_first_successful_value() { + let attempts = Arc::new(Mutex::new(0)); + let attempts_for_probe = Arc::clone(&attempts); + + let result = wait_until( + "counter reaches two", + Duration::from_secs(1), + Duration::from_millis(1), + move || { + let attempts_for_probe = Arc::clone(&attempts_for_probe); + async move { + let mut guard = attempts_for_probe + .lock() + .map_err(|_| anyhow::anyhow!("poisoned"))?; + *guard += 1; + if *guard >= 2 { + Ok(Some(*guard)) + } else { + Ok(None) + } + } + }, + ) + .await + .expect("wait succeeds"); + + assert_eq!(result, 2); + } +} diff --git a/e2e/src/lib.rs b/e2e/src/lib.rs new file mode 100644 index 0000000..fd09500 --- /dev/null +++ b/e2e/src/lib.rs @@ -0,0 +1,18 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#![forbid(unsafe_code)] + +pub mod cases; +pub mod framework; diff --git a/e2e/tests/console.rs b/e2e/tests/console.rs new file mode 100644 index 0000000..9bc6894 --- /dev/null +++ b/e2e/tests/console.rs @@ -0,0 +1,79 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use anyhow::{Result, ensure}; +use rustfs_operator_e2e::framework::{ + config::E2eConfig, + console_client::ConsoleClient, + live, + port_forward::{PortForwardGuard, PortForwardSpec}, +}; +use serde_json::Value; +use std::time::{Duration, Instant}; +use tokio::time::sleep; + +const CONSOLE_READY_TIMEOUT: Duration = Duration::from_secs(20); + +#[tokio::test] +#[ignore = "requires Console API reachability; run through `make e2e-live-run`"] +async fn console_live_health_ready_and_openapi_are_available() -> Result<()> { + let config = E2eConfig::from_env(); + live::require_live_enabled(&config)?; + live::ensure_dedicated_context(&config)?; + + let console_url = PortForwardSpec::console(&config.operator_namespace).local_base_url(); + let mut port_forward = PortForwardSpec::start_console(&config)?; + let console = ConsoleClient::new(&console_url)?; + wait_for_console_health(&mut port_forward, &console).await?; + let health = console.get_text("/healthz").await?; + let ready = console.get_text("/readyz").await?; + let openapi = console.get_json::("/api-docs/openapi.json").await?; + + ensure!(health.contains("OK"), "unexpected healthz body: {health}"); + ensure!(ready.contains("Ready"), "unexpected readyz body: {ready}"); + ensure!( + openapi.pointer("/paths/~1api~1v1~1tenants").is_some(), + "OpenAPI document does not contain /api/v1/tenants" + ); + ensure!( + openapi.pointer("/paths/~1api~1v1~1login").is_some(), + "OpenAPI document does not contain /api/v1/login" + ); + + Ok(()) +} + +async fn wait_for_console_health( + port_forward: &mut PortForwardGuard, + console: &ConsoleClient, +) -> Result<()> { + let deadline = Instant::now() + CONSOLE_READY_TIMEOUT; + + loop { + port_forward.ensure_running()?; + if console.get_text("/healthz").await.is_ok() { + return Ok(()); + } + if Instant::now() >= deadline { + anyhow::bail!( + "console port-forward not ready after {:?}; command: {}; log {}:\n{}", + CONSOLE_READY_TIMEOUT, + port_forward.command_display(), + port_forward.log_path().display(), + port_forward.log_contents() + ); + } + sleep(Duration::from_secs(1)).await; + } +} diff --git a/e2e/tests/faults.rs b/e2e/tests/faults.rs new file mode 100644 index 0000000..c3b3252 --- /dev/null +++ b/e2e/tests/faults.rs @@ -0,0 +1,36 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use anyhow::Result; +use rustfs_operator_e2e::framework::{config::E2eConfig, live}; + +#[test] +fn faults_are_not_destructive_without_explicit_opt_in() { + let config = E2eConfig::defaults(); + + assert!(!config.destructive_enabled); + assert!(live::require_destructive_enabled(&config).is_err()); +} + +#[test] +#[ignore = "reserved for destructive fault scenarios; no public live target in the reduced workflow"] +fn fault_live_suite_requires_explicit_destructive_opt_in() -> Result<()> { + let config = E2eConfig::from_env(); + + live::require_live_enabled(&config)?; + live::ensure_dedicated_context(&config)?; + live::require_destructive_enabled(&config)?; + + Ok(()) +} diff --git a/e2e/tests/operator.rs b/e2e/tests/operator.rs new file mode 100644 index 0000000..6a1de3a --- /dev/null +++ b/e2e/tests/operator.rs @@ -0,0 +1,44 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use anyhow::{Result, ensure}; +use kube::Api; +use rustfs_operator_e2e::framework::{assertions, config::E2eConfig, kube_client, live}; + +use operator::types::v1alpha1::tenant::Tenant; + +#[tokio::test] +#[ignore = "requires a live Tenant; run through `make e2e-live-run`"] +async fn operator_live_tenant_is_ready_and_observed() -> Result<()> { + let config = E2eConfig::from_env(); + live::require_live_enabled(&config)?; + live::ensure_dedicated_context(&config)?; + + let client = kube_client::default_client().await?; + let tenants: Api = kube_client::tenant_api(client, &config.test_namespace); + let tenant = tenants.get(&config.tenant_name).await?; + + ensure!( + assertions::current_state(&tenant) == Some("Ready"), + "tenant {} in namespace {} is not Ready: {:?}", + config.tenant_name, + config.test_namespace, + tenant.status + ); + assertions::require_condition(&tenant, "Ready", "True")?; + assertions::require_condition(&tenant, "Degraded", "False")?; + assertions::require_observed_generation_current(&tenant)?; + + Ok(()) +} diff --git a/e2e/tests/smoke.rs b/e2e/tests/smoke.rs new file mode 100644 index 0000000..bf8ff05 --- /dev/null +++ b/e2e/tests/smoke.rs @@ -0,0 +1,75 @@ +// Copyright 2025 RustFS Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use anyhow::Result; +use rustfs_operator_e2e::framework::{ + artifacts::ArtifactCollector, config::E2eConfig, deploy, kube_client, live, resources, storage, + tools::required_tool_checks, wait, +}; + +#[test] +fn smoke_required_tool_inventory_is_defined() { + assert!(required_tool_checks().len() >= 4); +} + +#[test] +#[ignore = "requires a dedicated Kind cluster; run through `make e2e-live-run`"] +fn smoke_dedicated_context_is_active() -> Result<()> { + let config = E2eConfig::from_env(); + + live::require_live_enabled(&config)?; + live::ensure_dedicated_context(&config)?; + Ok(()) +} + +#[test] +#[ignore = "requires deployed operator components; run through `make e2e-live-run`"] +fn smoke_control_plane_deployments_are_ready() -> Result<()> { + let config = E2eConfig::from_env(); + live::require_live_enabled(&config)?; + live::ensure_dedicated_context(&config)?; + deploy::wait_control_plane_rollout(&config)?; + + Ok(()) +} + +#[tokio::test] +#[ignore = "creates storage, credentials, and a Tenant; run through `make e2e-live-run`"] +async fn smoke_apply_tenant_and_wait_ready() -> Result<()> { + let config = E2eConfig::from_env(); + live::require_live_enabled(&config)?; + live::ensure_dedicated_context(&config)?; + + let result = async { + storage::prepare_local_storage(&config)?; + resources::apply_smoke_tenant_resources(&config)?; + + let client = kube_client::default_client().await?; + let tenants = kube_client::tenant_api(client, &config.test_namespace); + wait::wait_for_tenant_ready(tenants, &config.tenant_name, config.timeout).await?; + Ok(()) + } + .await; + + if let Err(error) = &result { + let collector = ArtifactCollector::new(&config.artifacts_dir); + if let Err(artifact_error) = + collector.collect_kubernetes_snapshot("smoke_apply_tenant_and_wait_ready", &config) + { + eprintln!("failed to collect e2e artifacts after {error}: {artifact_error}"); + } + } + + result +} diff --git a/scripts/test/script-test.sh b/scripts/test/script-test.sh index a82e1c5..465732c 100755 --- a/scripts/test/script-test.sh +++ b/scripts/test/script-test.sh @@ -42,5 +42,54 @@ grep -q '^ - name: RUSTFS_UNSAFE_BYPASS_DISK_CHECK$' examples/tenant-4nodes.y && echo " ✓ Kind demo bypasses same-disk safety check explicitly" \ || { echo " ✗ examples/tenant-4nodes.yaml must set RUSTFS_UNSAFE_BYPASS_DISK_CHECK=true for local Kind PVs"; exit 1; } +echo "9. Checking Rust-native e2e harness skeleton exists..." +for required_file in \ + e2e/Cargo.toml \ + e2e/README.md \ + e2e/manifests/kind-rustfs-e2e.yaml \ + e2e/src/lib.rs \ + e2e/src/framework/mod.rs \ + e2e/src/framework/config.rs \ + e2e/src/framework/command.rs \ + e2e/src/framework/kind.rs \ + e2e/src/framework/kubectl.rs \ + e2e/src/framework/live.rs \ + e2e/src/framework/tools.rs \ + e2e/src/framework/kube_client.rs \ + e2e/src/framework/console_client.rs \ + e2e/src/framework/wait.rs \ + e2e/src/framework/artifacts.rs \ + e2e/src/framework/port_forward.rs \ + e2e/src/framework/resources.rs \ + e2e/src/framework/storage.rs \ + e2e/src/framework/deploy.rs \ + e2e/src/framework/images.rs \ + e2e/src/framework/assertions.rs \ + e2e/src/framework/tenant_factory.rs \ + e2e/src/cases/mod.rs \ + e2e/src/cases/smoke.rs \ + e2e/src/cases/operator.rs \ + e2e/src/cases/console.rs \ + e2e/src/bin/rustfs-e2e.rs \ + e2e/tests/smoke.rs \ + e2e/tests/operator.rs \ + e2e/tests/console.rs \ + e2e/tests/faults.rs; do + test -f "$required_file" || { echo " ✗ Missing $required_file"; exit 1; } +done +echo " ✓ Rust-native e2e harness skeleton files exist" + +echo "10. Checking reduced e2e Makefile entrypoints are exposed..." +actual_e2e_targets=$(grep -E '^e2e-[A-Za-z0-9_-]+:' Makefile | cut -d: -f1 | sort | tr '\n' ' ' | sed 's/ $//') +expected_e2e_targets=$(printf '%s\n' e2e-check e2e-live-create e2e-live-delete e2e-live-run e2e-live-update | sort | tr '\n' ' ' | sed 's/ $//') +if [ "$actual_e2e_targets" = "$expected_e2e_targets" ]; then + echo " ✓ reduced e2e Makefile targets exist" +else + echo " ✗ Makefile must expose only e2e-check plus the four live entrypoints" + echo " expected: $expected_e2e_targets" + echo " actual: $actual_e2e_targets" + exit 1 +fi + echo "" echo "All script checks passed! ✅"