From c4c7c75935a099985ebc9850400dbbfc5cbaaa72 Mon Sep 17 00:00:00 2001 From: Siegfried Weber Date: Thu, 18 Jun 2026 12:55:48 +0200 Subject: [PATCH 01/10] Use the framework code from stackable-operator --- Cargo.lock | 118 ++- Cargo.nix | 397 ++++---- Cargo.toml | 2 +- crate-hashes.json | 18 +- extra/crds.yaml | 82 +- rust/operator-binary/Cargo.toml | 7 + rust/operator-binary/src/controller.rs | 49 +- rust/operator-binary/src/controller/apply.rs | 14 +- rust/operator-binary/src/controller/build.rs | 26 +- .../src/controller/build/node_config.rs | 51 +- .../build/product_logging/config.rs | 8 +- .../src/controller/build/role_builder.rs | 50 +- .../controller/build/role_group_builder.rs | 83 +- .../src/controller/dereference.rs | 17 +- .../src/controller/validate.rs | 87 +- rust/operator-binary/src/crd/mod.rs | 21 +- rust/operator-binary/src/framework.rs | 53 - rust/operator-binary/src/framework/builder.rs | 4 - .../src/framework/builder/meta.rs | 124 --- .../src/framework/builder/pdb.rs | 189 ---- .../src/framework/builder/pod.rs | 2 - .../src/framework/builder/pod/container.rs | 380 ------- .../src/framework/builder/pod/volume.rs | 48 - .../src/framework/builder/statefulset.rs | 118 --- .../src/framework/cluster_resources.rs | 50 - .../src/framework/config_overrides.rs | 443 --------- .../src/framework/controller_utils.rs | 211 ---- rust/operator-binary/src/framework/kvp.rs | 1 - .../src/framework/kvp/label.rs | 212 ---- rust/operator-binary/src/framework/macros.rs | 2 - .../macros/attributed_string_type.rs | 923 ------------------ .../src/framework/macros/constant.rs | 17 - .../src/framework/product_logging.rs | 1 - .../framework/product_logging/framework.rs | 502 ---------- .../src/framework/role_group_utils.rs | 153 --- .../src/framework/role_utils.rs | 378 ------- rust/operator-binary/src/framework/types.rs | 3 - .../src/framework/types/common.rs | 68 -- .../src/framework/types/kubernetes.rs | 191 ---- .../src/framework/types/operator.rs | 91 -- rust/operator-binary/src/main.rs | 3 +- 41 files changed, 575 insertions(+), 4622 deletions(-) delete mode 100644 rust/operator-binary/src/framework.rs delete mode 100644 rust/operator-binary/src/framework/builder.rs delete mode 100644 rust/operator-binary/src/framework/builder/meta.rs delete mode 100644 rust/operator-binary/src/framework/builder/pdb.rs delete mode 100644 rust/operator-binary/src/framework/builder/pod.rs delete mode 100644 rust/operator-binary/src/framework/builder/pod/container.rs delete mode 100644 rust/operator-binary/src/framework/builder/pod/volume.rs delete mode 100644 rust/operator-binary/src/framework/builder/statefulset.rs delete mode 100644 rust/operator-binary/src/framework/cluster_resources.rs delete mode 100644 rust/operator-binary/src/framework/config_overrides.rs delete mode 100644 rust/operator-binary/src/framework/controller_utils.rs delete mode 100644 rust/operator-binary/src/framework/kvp.rs delete mode 100644 rust/operator-binary/src/framework/kvp/label.rs delete mode 100644 rust/operator-binary/src/framework/macros.rs delete mode 100644 rust/operator-binary/src/framework/macros/attributed_string_type.rs delete mode 100644 rust/operator-binary/src/framework/macros/constant.rs delete mode 100644 rust/operator-binary/src/framework/product_logging.rs delete mode 100644 rust/operator-binary/src/framework/product_logging/framework.rs delete mode 100644 rust/operator-binary/src/framework/role_group_utils.rs delete mode 100644 rust/operator-binary/src/framework/role_utils.rs delete mode 100644 rust/operator-binary/src/framework/types.rs delete mode 100644 rust/operator-binary/src/framework/types/common.rs delete mode 100644 rust/operator-binary/src/framework/types/kubernetes.rs delete mode 100644 rust/operator-binary/src/framework/types/operator.rs diff --git a/Cargo.lock b/Cargo.lock index ad93da41..9bb2ffdf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1532,11 +1532,11 @@ dependencies = [ [[package]] name = "k8s-version" version = "0.1.3" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#7a5f0c3fbcd091340214a23f0607fcd4b4fcc152" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#f3a0923138059bfdfe1bb7115341c85187167e86" dependencies = [ "darling", "regex", - "snafu 0.9.0", + "snafu 0.9.1", ] [[package]] @@ -1857,9 +1857,9 @@ checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" [[package]] name = "opentelemetry" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84bcd6ae87133e903af7ef497404dda70c60d0ea14895fc8a5e6722754fc2a0" +checksum = "b0142c63252a9e054e68a4c61a5778f7b14f576274d593f8ce883d191a099682" dependencies = [ "futures-core", "futures-sink", @@ -1871,9 +1871,9 @@ dependencies = [ [[package]] name = "opentelemetry-appender-tracing" -version = "0.31.1" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef6a1ac5ca3accf562b8c306fa8483c85f4390f768185ab775f242f7fe8fdcc2" +checksum = "2c0080f0dc1d7c786f467cd85a4e395fcab11ee852004f39a29a18ab7c25d837" dependencies = [ "opentelemetry", "tracing", @@ -1883,9 +1883,9 @@ dependencies = [ [[package]] name = "opentelemetry-http" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a6d09a73194e6b66df7c8f1b680f156d916a1a942abf2de06823dd02b7855d" +checksum = "5683015d09e2df236ef005b17f6f196f0d5f6313c4fa43a7b6a53b52776e4331" dependencies = [ "async-trait", "bytes", @@ -1896,9 +1896,9 @@ dependencies = [ [[package]] name = "opentelemetry-otlp" -version = "0.31.1" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f69cd6acbb9af919df949cd1ec9e5e7fdc2ef15d234b6b795aaa525cc02f71f" +checksum = "9966929966d17620d7c316c643ba62631826e10021409357772d5eea84f62c35" dependencies = [ "http", "opentelemetry", @@ -1910,14 +1910,14 @@ dependencies = [ "thiserror 2.0.18", "tokio", "tonic", - "tracing", + "tonic-types", ] [[package]] name = "opentelemetry-proto" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7175df06de5eaee9909d4805a3d07e28bb752c34cab57fa9cff549da596b30f" +checksum = "56d658ba1faf63f7b9c492cfbe6e0ec365440a16132d3270c1065f7b33f1b638" dependencies = [ "opentelemetry", "opentelemetry_sdk", @@ -1928,21 +1928,22 @@ dependencies = [ [[package]] name = "opentelemetry-semantic-conventions" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e62e29dfe041afb8ed2a6c9737ab57db4907285d999ef8ad3a59092a36bdc846" +checksum = "6ca2f98a0437b427b4b08f19f1caa3c44db885a202bc12cfea13d6c702243d68" [[package]] name = "opentelemetry_sdk" -version = "0.31.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ae4f5991976fd48df6d843de219ca6d31b01daaab2dad5af2badeded372bd" +checksum = "9b59f80e1ac4d5ff7a2db8fb6c80badb7f0f3f858211fba08dd9aaec750894f9" dependencies = [ "futures-channel", "futures-executor", "futures-util", "opentelemetry", "percent-encoding", + "portable-atomic", "rand 0.9.4", "thiserror 2.0.18", "tokio", @@ -2235,6 +2236,15 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "prost-types" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8991c4cbdb8bc5b11f0b074ffe286c30e523de90fee5ba8132f1399f23cb3dd7" +dependencies = [ + "prost", +] + [[package]] name = "quote" version = "1.0.45" @@ -2374,9 +2384,9 @@ checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" [[package]] name = "reqwest" -version = "0.12.28" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" +checksum = "219c5811de6525e5416c7d5d53bb656d3afdbc6c5af816e0802bcfa42dbdc1c3" dependencies = [ "base64", "bytes", @@ -2392,9 +2402,6 @@ dependencies = [ "log", "percent-encoding", "pin-project-lite", - "serde", - "serde_json", - "serde_urlencoded", "sync_wrapper", "tokio", "tower", @@ -2837,13 +2844,13 @@ dependencies = [ [[package]] name = "snafu" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1d4bced6a69f90b2056c03dcff2c4737f98d6fb9e0853493996e1d253ca29c6" +checksum = "d1a012328be2e3f5d5f6f3218147ca02588cea4cb865e876849ab6debcf36522" dependencies = [ "futures-core", "pin-project", - "snafu-derive 0.9.0", + "snafu-derive 0.9.1", ] [[package]] @@ -2871,9 +2878,9 @@ dependencies = [ [[package]] name = "snafu-derive" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54254b8531cafa275c5e096f62d48c81435d1015405a91198ddb11e967301d40" +checksum = "5f103c50866b8743da9429b8a581d81a27c2d3a9c4ac7df8f8571c1dd7896eda" dependencies = [ "heck", "proc-macro2", @@ -2916,7 +2923,7 @@ checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "stackable-certs" version = "0.4.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#7a5f0c3fbcd091340214a23f0607fcd4b4fcc152" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#f3a0923138059bfdfe1bb7115341c85187167e86" dependencies = [ "const-oid", "ecdsa", @@ -2928,7 +2935,7 @@ dependencies = [ "rsa", "sha2", "signature", - "snafu 0.9.0", + "snafu 0.9.1", "stackable-shared", "tokio", "tokio-rustls", @@ -2951,7 +2958,7 @@ dependencies = [ "serde", "serde_json", "serde_yaml", - "snafu 0.9.0", + "snafu 0.9.1", "stackable-operator", "strum", "tokio", @@ -2962,7 +2969,7 @@ dependencies = [ [[package]] name = "stackable-operator" version = "0.111.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#7a5f0c3fbcd091340214a23f0607fcd4b4fcc152" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#f3a0923138059bfdfe1bb7115341c85187167e86" dependencies = [ "base64", "clap", @@ -2974,6 +2981,7 @@ dependencies = [ "futures 0.3.32", "http", "indexmap", + "java-properties", "jiff", "json-patch", "k8s-openapi", @@ -2986,7 +2994,8 @@ dependencies = [ "serde", "serde_json", "serde_yaml", - "snafu 0.9.0", + "sha2", + "snafu 0.9.1", "stackable-operator-derive", "stackable-shared", "stackable-telemetry", @@ -2998,12 +3007,14 @@ dependencies = [ "tracing-appender", "tracing-subscriber", "url", + "uuid", + "xml", ] [[package]] name = "stackable-operator-derive" version = "0.3.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#7a5f0c3fbcd091340214a23f0607fcd4b4fcc152" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#f3a0923138059bfdfe1bb7115341c85187167e86" dependencies = [ "darling", "proc-macro2", @@ -3013,8 +3024,8 @@ dependencies = [ [[package]] name = "stackable-shared" -version = "0.1.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#7a5f0c3fbcd091340214a23f0607fcd4b4fcc152" +version = "0.1.1" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#f3a0923138059bfdfe1bb7115341c85187167e86" dependencies = [ "jiff", "k8s-openapi", @@ -3023,15 +3034,15 @@ dependencies = [ "semver", "serde", "serde_yaml", - "snafu 0.9.0", + "snafu 0.9.1", "strum", "time", ] [[package]] name = "stackable-telemetry" -version = "0.6.3" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#7a5f0c3fbcd091340214a23f0607fcd4b4fcc152" +version = "0.6.4" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#f3a0923138059bfdfe1bb7115341c85187167e86" dependencies = [ "axum", "clap", @@ -3042,7 +3053,7 @@ dependencies = [ "opentelemetry-semantic-conventions", "opentelemetry_sdk", "pin-project", - "snafu 0.9.0", + "snafu 0.9.1", "strum", "tokio", "tower", @@ -3055,21 +3066,21 @@ dependencies = [ [[package]] name = "stackable-versioned" version = "0.10.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#7a5f0c3fbcd091340214a23f0607fcd4b4fcc152" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#f3a0923138059bfdfe1bb7115341c85187167e86" dependencies = [ "kube", "schemars", "serde", "serde_json", "serde_yaml", - "snafu 0.9.0", + "snafu 0.9.1", "stackable-versioned-macros", ] [[package]] name = "stackable-versioned-macros" version = "0.10.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#7a5f0c3fbcd091340214a23f0607fcd4b4fcc152" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#f3a0923138059bfdfe1bb7115341c85187167e86" dependencies = [ "convert_case", "convert_case_extras", @@ -3087,7 +3098,7 @@ dependencies = [ [[package]] name = "stackable-webhook" version = "0.9.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#7a5f0c3fbcd091340214a23f0607fcd4b4fcc152" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#f3a0923138059bfdfe1bb7115341c85187167e86" dependencies = [ "arc-swap", "async-trait", @@ -3103,7 +3114,7 @@ dependencies = [ "rand 0.9.4", "serde", "serde_json", - "snafu 0.9.0", + "snafu 0.9.1", "stackable-certs", "stackable-shared", "stackable-telemetry", @@ -3439,6 +3450,17 @@ dependencies = [ "tonic", ] +[[package]] +name = "tonic-types" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a875a902255423d34c1f20838ab374126db8eb41625b7947a1d54113b0b7399" +dependencies = [ + "prost", + "prost-types", + "tonic", +] + [[package]] name = "tower" version = "0.5.3" @@ -3550,9 +3572,9 @@ dependencies = [ [[package]] name = "tracing-opentelemetry" -version = "0.32.1" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac28f2d093c6c477eaa76b23525478f38de514fa9aeb1285738d4b97a9552fc" +checksum = "adbc64cba7137545b8044cb1fe9814f7aacf3c6b5f9b45be8bb5db538befdb26" dependencies = [ "js-sys", "opentelemetry", @@ -3973,9 +3995,9 @@ dependencies = [ [[package]] name = "xml" -version = "1.2.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8aa498d22c9bbaf482329839bc5620c46be275a19a812e9a22a2b07529a642a" +checksum = "636f85e5ca6488e96401b61eb7de54f4e44755c988af0f52cf90230c312a1a89" [[package]] name = "yansi" diff --git a/Cargo.nix b/Cargo.nix index 232ee994..3240d986 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -4883,9 +4883,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech/operator-rs.git"; - rev = "7a5f0c3fbcd091340214a23f0607fcd4b4fcc152"; - sha256 = "0lj969rjbxairjglrnaq0xhabvdrq5nd6wl1i0y9pr50nhh7zvgk"; + url = "https://github.com/stackabletech//operator-rs.git"; + rev = "f3a0923138059bfdfe1bb7115341c85187167e86"; + sha256 = "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x"; }; libName = "k8s_version"; authors = [ @@ -4903,7 +4903,7 @@ rec { } { name = "snafu"; - packageId = "snafu 0.9.0"; + packageId = "snafu 0.9.1"; } ]; features = { @@ -6084,9 +6084,9 @@ rec { }; "opentelemetry" = rec { crateName = "opentelemetry"; - version = "0.31.0"; + version = "0.32.0"; edition = "2021"; - sha256 = "18629xsj4rsyiby9aj511q6wcw6s9m09gx3ymw1yjcvix1mcsjxq"; + sha256 = "10ln14d1jgc8rvw97mblc9blzcgpg1bimim4d170b7ia4mijq55h"; dependencies = [ { name = "futures-core"; @@ -6123,24 +6123,24 @@ rec { ]; features = { "default" = [ "trace" "metrics" "logs" "internal-logs" "futures" ]; + "experimental_metrics_bound_instruments" = [ "metrics" ]; "futures" = [ "futures-core" "futures-sink" "pin-project-lite" ]; "futures-core" = [ "dep:futures-core" ]; "futures-sink" = [ "dep:futures-sink" ]; "internal-logs" = [ "tracing" ]; "pin-project-lite" = [ "dep:pin-project-lite" ]; - "spec_unstable_logs_enabled" = [ "logs" ]; "testing" = [ "trace" ]; "thiserror" = [ "dep:thiserror" ]; "trace" = [ "futures" "thiserror" ]; "tracing" = [ "dep:tracing" ]; }; - resolvedDefaultFeatures = [ "default" "futures" "futures-core" "futures-sink" "internal-logs" "logs" "metrics" "pin-project-lite" "spec_unstable_logs_enabled" "thiserror" "trace" "tracing" ]; + resolvedDefaultFeatures = [ "default" "futures" "futures-core" "futures-sink" "internal-logs" "logs" "metrics" "pin-project-lite" "thiserror" "trace" "tracing" ]; }; "opentelemetry-appender-tracing" = rec { crateName = "opentelemetry-appender-tracing"; - version = "0.31.1"; + version = "0.32.0"; edition = "2021"; - sha256 = "1hnwizzgfhpjfnvml638yy846py8hf2gl1n3p1igbk1srb2ilspg"; + sha256 = "0dyq4myan64sl8wly02jx0gb3jjz7575mn3w8rpphz0xvkq8001c"; libName = "opentelemetry_appender_tracing"; dependencies = [ { @@ -6183,18 +6183,15 @@ rec { ]; features = { "experimental_metadata_attributes" = [ "dep:tracing-log" ]; - "experimental_use_tracing_span_context" = [ "tracing-opentelemetry" ]; "log" = [ "dep:log" ]; - "spec_unstable_logs_enabled" = [ "opentelemetry/spec_unstable_logs_enabled" ]; - "tracing-opentelemetry" = [ "dep:tracing-opentelemetry" ]; }; resolvedDefaultFeatures = [ "default" ]; }; "opentelemetry-http" = rec { crateName = "opentelemetry-http"; - version = "0.31.0"; + version = "0.32.0"; edition = "2021"; - sha256 = "0pc5nw1ds8v8w0nvyall39m92v8m1xl1p3vwvxk6nkhrffdd19np"; + sha256 = "0ca3drvm4fx5nskl7yn42dimy3bg35ppzc85y1p27pz215fh30sn"; libName = "opentelemetry_http"; dependencies = [ { @@ -6230,16 +6227,16 @@ rec { "internal-logs" = [ "opentelemetry/internal-logs" ]; "reqwest" = [ "dep:reqwest" ]; "reqwest-blocking" = [ "dep:reqwest" "reqwest/blocking" ]; - "reqwest-rustls" = [ "dep:reqwest" "reqwest/rustls-tls-native-roots" ]; - "reqwest-rustls-webpki-roots" = [ "dep:reqwest" "reqwest/rustls-tls-webpki-roots" ]; + "reqwest-rustls" = [ "dep:reqwest" "reqwest/default-tls" ]; + "reqwest-rustls-webpki-roots" = [ "dep:reqwest" "reqwest/default-tls" "reqwest/webpki-roots" ]; }; - resolvedDefaultFeatures = [ "internal-logs" "reqwest" "reqwest-blocking" ]; + resolvedDefaultFeatures = [ "reqwest" "reqwest-blocking" ]; }; "opentelemetry-otlp" = rec { crateName = "opentelemetry-otlp"; - version = "0.31.1"; + version = "0.32.0"; edition = "2021"; - sha256 = "07zp0b62b9dajnvvcd6j2ppw5zg7wp4ixka9z6fr3bxrrdmcss8z"; + sha256 = "0d9cys2flpidfxbr6h1103hjc633cax47ihnqgbj0xnicscr4rlr"; libName = "opentelemetry_otlp"; dependencies = [ { @@ -6300,10 +6297,9 @@ rec { usesDefaultFeatures = false; } { - name = "tracing"; - packageId = "tracing"; + name = "tonic-types"; + packageId = "tonic-types"; optional = true; - usesDefaultFeatures = false; } ]; devDependencies = [ @@ -6328,16 +6324,19 @@ rec { ]; features = { "default" = [ "http-proto" "reqwest-blocking-client" "trace" "metrics" "logs" "internal-logs" ]; + "experimental-grpc-retry" = [ "grpc-tonic" "opentelemetry_sdk/experimental_async_runtime" "opentelemetry_sdk/rt-tokio" ]; + "experimental-http-retry" = [ "opentelemetry_sdk/experimental_async_runtime" "opentelemetry_sdk/rt-tokio" "tokio" "httpdate" ]; "flate2" = [ "dep:flate2" ]; - "grpc-tonic" = [ "tonic" "prost" "http" "tokio" "opentelemetry-proto/gen-tonic" ]; + "grpc-tonic" = [ "tonic" "tonic-types" "prost" "http" "tokio" "opentelemetry-proto/gen-tonic" ]; "gzip-http" = [ "flate2" ]; "gzip-tonic" = [ "tonic/gzip" ]; "http" = [ "dep:http" ]; "http-json" = [ "serde_json" "prost" "opentelemetry-http" "opentelemetry-proto/gen-tonic-messages" "opentelemetry-proto/with-serde" "http" "trace" "metrics" ]; "http-proto" = [ "prost" "opentelemetry-http" "opentelemetry-proto/gen-tonic-messages" "http" "trace" "metrics" ]; + "httpdate" = [ "dep:httpdate" ]; "hyper-client" = [ "opentelemetry-http/hyper" ]; "integration-testing" = [ "tonic" "prost" "tokio/full" "trace" "logs" ]; - "internal-logs" = [ "tracing" "opentelemetry_sdk/internal-logs" "opentelemetry-http/internal-logs" ]; + "internal-logs" = [ "opentelemetry_sdk/internal-logs" "opentelemetry/internal-logs" ]; "logs" = [ "opentelemetry/logs" "opentelemetry_sdk/logs" "opentelemetry-proto/logs" ]; "metrics" = [ "opentelemetry/metrics" "opentelemetry_sdk/metrics" "opentelemetry-proto/metrics" ]; "opentelemetry-http" = [ "dep:opentelemetry-http" ]; @@ -6350,27 +6349,27 @@ rec { "serde" = [ "dep:serde" ]; "serde_json" = [ "dep:serde_json" ]; "serialize" = [ "serde" "serde_json" ]; - "tls" = [ "tonic/tls-ring" ]; + "tls" = [ "tls-ring" ]; "tls-aws-lc" = [ "tonic/tls-aws-lc" ]; "tls-provider-agnostic" = [ "tonic/_tls-any" ]; "tls-ring" = [ "tonic/tls-ring" ]; - "tls-roots" = [ "tls" "tonic/tls-native-roots" ]; - "tls-webpki-roots" = [ "tls" "tonic/tls-webpki-roots" ]; + "tls-roots" = [ "tonic/tls-native-roots" ]; + "tls-webpki-roots" = [ "tonic/tls-webpki-roots" ]; "tokio" = [ "dep:tokio" ]; "tonic" = [ "dep:tonic" ]; + "tonic-types" = [ "dep:tonic-types" ]; "trace" = [ "opentelemetry/trace" "opentelemetry_sdk/trace" "opentelemetry-proto/trace" ]; - "tracing" = [ "dep:tracing" ]; "zstd" = [ "dep:zstd" ]; "zstd-http" = [ "zstd" ]; "zstd-tonic" = [ "tonic/zstd" ]; }; - resolvedDefaultFeatures = [ "default" "grpc-tonic" "gzip-tonic" "http" "http-proto" "internal-logs" "logs" "metrics" "opentelemetry-http" "prost" "reqwest" "reqwest-blocking-client" "tokio" "tonic" "trace" "tracing" ]; + resolvedDefaultFeatures = [ "default" "grpc-tonic" "gzip-tonic" "http" "http-proto" "internal-logs" "logs" "metrics" "opentelemetry-http" "prost" "reqwest" "reqwest-blocking-client" "tokio" "tonic" "tonic-types" "trace" ]; }; "opentelemetry-proto" = rec { crateName = "opentelemetry-proto"; - version = "0.31.0"; + version = "0.32.0"; edition = "2021"; - sha256 = "03xkjsjrsm7zkkx5gascqd9bg2z20wymm06l16cyxsp5dpq5s5x7"; + sha256 = "0f5ny4rpnpq6q5q34b8k2q548rf31rpbxkwjqjwzfqxg3yx5imjn"; libName = "opentelemetry_proto"; dependencies = [ { @@ -6414,30 +6413,29 @@ rec { "const-hex" = [ "dep:const-hex" ]; "default" = [ "full" ]; "full" = [ "gen-tonic" "trace" "logs" "metrics" "zpages" "with-serde" "internal-logs" ]; - "gen-tonic" = [ "gen-tonic-messages" "tonic/channel" ]; - "gen-tonic-messages" = [ "tonic" "tonic-prost" "prost" ]; + "gen-tonic" = [ "gen-tonic-messages" "tonic" "tonic-prost" "tonic/channel" ]; + "gen-tonic-messages" = [ "prost" ]; "internal-logs" = [ "opentelemetry/internal-logs" ]; "logs" = [ "opentelemetry/logs" "opentelemetry_sdk/logs" ]; "metrics" = [ "opentelemetry/metrics" "opentelemetry_sdk/metrics" ]; "prost" = [ "dep:prost" ]; "schemars" = [ "dep:schemars" ]; "serde" = [ "dep:serde" ]; - "serde_json" = [ "dep:serde_json" ]; "testing" = [ "opentelemetry/testing" ]; "tonic" = [ "dep:tonic" ]; "tonic-prost" = [ "dep:tonic-prost" ]; "trace" = [ "opentelemetry/trace" "opentelemetry_sdk/trace" ]; "with-schemars" = [ "schemars" ]; - "with-serde" = [ "serde" "const-hex" "base64" "serde_json" ]; + "with-serde" = [ "serde" "const-hex" "base64" ]; "zpages" = [ "trace" ]; }; resolvedDefaultFeatures = [ "gen-tonic" "gen-tonic-messages" "logs" "metrics" "prost" "tonic" "tonic-prost" "trace" ]; }; "opentelemetry-semantic-conventions" = rec { crateName = "opentelemetry-semantic-conventions"; - version = "0.31.0"; + version = "0.32.0"; edition = "2021"; - sha256 = "0in8plv2l2ar7anzi7lrbll0fjfvaymkg5vc5bnvibs1w3gjjbp6"; + sha256 = "0s1x4h1cgmhkxb7i5g02la2vhkf4lg5g26cgn2s2gd1p0j5gk8kc"; libName = "opentelemetry_semantic_conventions"; features = { }; @@ -6445,9 +6443,9 @@ rec { }; "opentelemetry_sdk" = rec { crateName = "opentelemetry_sdk"; - version = "0.31.0"; + version = "0.32.1"; edition = "2021"; - sha256 = "1gbjsggdxfpjbanjvaxa3nq32vfa37i3v13dvx4gsxhrk7sy8jp1"; + sha256 = "1ycl11syranrinhgn4c2hlzhyzyvpa06ryxq5mxgzmf4387ghncv"; dependencies = [ { name = "futures-channel"; @@ -6473,6 +6471,13 @@ rec { packageId = "percent-encoding"; optional = true; } + { + name = "portable-atomic"; + packageId = "portable-atomic"; + usesDefaultFeatures = false; + target = { target, features }: (!("64" == target."has_atomic" or null)); + features = [ "fallback" ]; + } { name = "rand"; packageId = "rand 0.9.4"; @@ -6497,10 +6502,18 @@ rec { optional = true; } ]; + devDependencies = [ + { + name = "tokio"; + packageId = "tokio"; + usesDefaultFeatures = false; + features = [ "macros" "rt-multi-thread" ]; + } + ]; features = { "default" = [ "trace" "metrics" "logs" "internal-logs" ]; "experimental_logs_batch_log_processor_with_async_runtime" = [ "logs" "experimental_async_runtime" ]; - "experimental_logs_concurrent_log_processor" = [ "logs" ]; + "experimental_metrics_bound_instruments" = [ "metrics" "opentelemetry/experimental_metrics_bound_instruments" ]; "experimental_metrics_custom_reader" = [ "metrics" ]; "experimental_metrics_disable_name_validation" = [ "metrics" ]; "experimental_metrics_periodicreader_with_async_runtime" = [ "metrics" "experimental_async_runtime" ]; @@ -6517,15 +6530,14 @@ rec { "rt-tokio-current-thread" = [ "tokio/rt" "tokio/time" "tokio-stream" "experimental_async_runtime" ]; "serde" = [ "dep:serde" ]; "serde_json" = [ "dep:serde_json" ]; - "spec_unstable_logs_enabled" = [ "logs" "opentelemetry/spec_unstable_logs_enabled" ]; "spec_unstable_metrics_views" = [ "metrics" ]; - "testing" = [ "opentelemetry/testing" "trace" "metrics" "logs" "rt-tokio" "rt-tokio-current-thread" "tokio/macros" "tokio/rt-multi-thread" ]; + "testing" = [ "opentelemetry/testing" "trace" "metrics" "logs" "tokio/sync" ]; "tokio" = [ "dep:tokio" ]; "tokio-stream" = [ "dep:tokio-stream" ]; "trace" = [ "opentelemetry/trace" "rand" "percent-encoding" ]; "url" = [ "dep:url" ]; }; - resolvedDefaultFeatures = [ "default" "experimental_async_runtime" "internal-logs" "logs" "metrics" "percent-encoding" "rand" "rt-tokio" "spec_unstable_logs_enabled" "tokio" "tokio-stream" "trace" ]; + resolvedDefaultFeatures = [ "default" "experimental_async_runtime" "internal-logs" "logs" "metrics" "percent-encoding" "rand" "rt-tokio" "tokio" "tokio-stream" "trace" ]; }; "ordered-float" = rec { crateName = "ordered-float"; @@ -7034,7 +7046,7 @@ rec { "default" = [ "fallback" ]; "serde" = [ "dep:serde" ]; }; - resolvedDefaultFeatures = [ "require-cas" ]; + resolvedDefaultFeatures = [ "fallback" "require-cas" ]; }; "portable-atomic-util" = rec { crateName = "portable-atomic-util"; @@ -7327,6 +7339,34 @@ rec { ]; }; + "prost-types" = rec { + crateName = "prost-types"; + version = "0.14.3"; + edition = "2021"; + sha256 = "1mrxrciryfgi6a0vmrgyj3g27r9hdhlgwkq71cgv3icbvg5w94c9"; + libName = "prost_types"; + authors = [ + "Dan Burkert " + "Lucio Franco " + "Casper Meijn " + "Tokio Contributors " + ]; + dependencies = [ + { + name = "prost"; + packageId = "prost"; + usesDefaultFeatures = false; + features = [ "derive" ]; + } + ]; + features = { + "arbitrary" = [ "dep:arbitrary" ]; + "chrono" = [ "dep:chrono" ]; + "default" = [ "std" ]; + "std" = [ "prost/std" ]; + }; + resolvedDefaultFeatures = [ "default" "std" ]; + }; "quote" = rec { crateName = "quote"; version = "1.0.45"; @@ -7756,9 +7796,9 @@ rec { }; "reqwest" = rec { crateName = "reqwest"; - version = "0.12.28"; + version = "0.13.4"; edition = "2021"; - sha256 = "0iqidijghgqbzl3bjg5hb4zmigwa4r612bgi0yiq0c90b6jkrpgd"; + sha256 = "1hy1plns9krbh3h1dy2sdjygsfkdcnxm6pbxdi0ya9b5vq8mi711"; authors = [ "Sean McArthur " ]; @@ -7775,7 +7815,7 @@ rec { name = "futures-channel"; packageId = "futures-channel"; optional = true; - target = { target, features }: (!("wasm32" == target."arch" or null)); + target = { target, features }: (!(("wasm32" == target."arch" or null) && (("unknown" == target."os" or null) || ("none" == target."os" or null)))); } { name = "futures-core"; @@ -7795,62 +7835,44 @@ rec { { name = "http-body"; packageId = "http-body"; - target = { target, features }: (!("wasm32" == target."arch" or null)); + target = { target, features }: (!(("wasm32" == target."arch" or null) && (("unknown" == target."os" or null) || ("none" == target."os" or null)))); } { name = "http-body-util"; packageId = "http-body-util"; - target = { target, features }: (!("wasm32" == target."arch" or null)); + target = { target, features }: (!(("wasm32" == target."arch" or null) && (("unknown" == target."os" or null) || ("none" == target."os" or null)))); } { name = "hyper"; packageId = "hyper"; - target = { target, features }: (!("wasm32" == target."arch" or null)); + target = { target, features }: (!(("wasm32" == target."arch" or null) && (("unknown" == target."os" or null) || ("none" == target."os" or null)))); features = [ "http1" "client" ]; } { name = "hyper-util"; packageId = "hyper-util"; - target = { target, features }: (!("wasm32" == target."arch" or null)); + target = { target, features }: (!(("wasm32" == target."arch" or null) && (("unknown" == target."os" or null) || ("none" == target."os" or null)))); features = [ "http1" "client" "client-legacy" "client-proxy" "tokio" ]; } { name = "js-sys"; packageId = "js-sys"; - target = { target, features }: ("wasm32" == target."arch" or null); + target = { target, features }: (("wasm32" == target."arch" or null) && (("unknown" == target."os" or null) || ("none" == target."os" or null))); } { name = "log"; packageId = "log"; - target = { target, features }: (!("wasm32" == target."arch" or null)); + target = { target, features }: (!(("wasm32" == target."arch" or null) && (("unknown" == target."os" or null) || ("none" == target."os" or null)))); } { name = "percent-encoding"; packageId = "percent-encoding"; - target = { target, features }: (!("wasm32" == target."arch" or null)); + target = { target, features }: (!(("wasm32" == target."arch" or null) && (("unknown" == target."os" or null) || ("none" == target."os" or null)))); } { name = "pin-project-lite"; packageId = "pin-project-lite"; - target = { target, features }: (!("wasm32" == target."arch" or null)); - } - { - name = "serde"; - packageId = "serde"; - } - { - name = "serde_json"; - packageId = "serde_json"; - optional = true; - } - { - name = "serde_json"; - packageId = "serde_json"; - target = { target, features }: ("wasm32" == target."arch" or null); - } - { - name = "serde_urlencoded"; - packageId = "serde_urlencoded"; + target = { target, features }: (!(("wasm32" == target."arch" or null) && (("unknown" == target."os" or null) || ("none" == target."os" or null)))); } { name = "sync_wrapper"; @@ -7861,27 +7883,27 @@ rec { name = "tokio"; packageId = "tokio"; usesDefaultFeatures = false; - target = { target, features }: (!("wasm32" == target."arch" or null)); + target = { target, features }: (!(("wasm32" == target."arch" or null) && (("unknown" == target."os" or null) || ("none" == target."os" or null)))); features = [ "net" "time" ]; } { name = "tower"; packageId = "tower"; usesDefaultFeatures = false; - target = { target, features }: (!("wasm32" == target."arch" or null)); + target = { target, features }: (!(("wasm32" == target."arch" or null) && (("unknown" == target."os" or null) || ("none" == target."os" or null)))); features = [ "retry" "timeout" "util" ]; } { name = "tower-http"; packageId = "tower-http"; usesDefaultFeatures = false; - target = { target, features }: (!("wasm32" == target."arch" or null)); + target = { target, features }: (!(("wasm32" == target."arch" or null) && (("unknown" == target."os" or null) || ("none" == target."os" or null)))); features = [ "follow-redirect" ]; } { name = "tower-service"; packageId = "tower-service"; - target = { target, features }: (!("wasm32" == target."arch" or null)); + target = { target, features }: (!(("wasm32" == target."arch" or null) && (("unknown" == target."os" or null) || ("none" == target."os" or null)))); } { name = "url"; @@ -7890,17 +7912,17 @@ rec { { name = "wasm-bindgen"; packageId = "wasm-bindgen"; - target = { target, features }: ("wasm32" == target."arch" or null); + target = { target, features }: (("wasm32" == target."arch" or null) && (("unknown" == target."os" or null) || ("none" == target."os" or null))); } { name = "wasm-bindgen-futures"; packageId = "wasm-bindgen-futures"; - target = { target, features }: ("wasm32" == target."arch" or null); + target = { target, features }: (("wasm32" == target."arch" or null) && (("unknown" == target."os" or null) || ("none" == target."os" or null))); } { name = "web-sys"; packageId = "web-sys"; - target = { target, features }: ("wasm32" == target."arch" or null); + target = { target, features }: (("wasm32" == target."arch" or null) && (("unknown" == target."os" or null) || ("none" == target."os" or null))); features = [ "AbortController" "AbortSignal" "Headers" "Request" "RequestInit" "RequestMode" "Response" "Window" "FormData" "Blob" "BlobPropertyBag" "ServiceWorkerGlobalScope" "RequestCredentials" "File" "ReadableStream" "RequestCache" ]; } ]; @@ -7909,33 +7931,27 @@ rec { name = "futures-util"; packageId = "futures-util"; usesDefaultFeatures = false; - target = { target, features }: (!("wasm32" == target."arch" or null)); + target = { target, features }: (!(("wasm32" == target."arch" or null) && (("unknown" == target."os" or null) || ("none" == target."os" or null)))); features = [ "std" "alloc" ]; } { name = "hyper"; packageId = "hyper"; usesDefaultFeatures = false; - target = { target, features }: (!("wasm32" == target."arch" or null)); + target = { target, features }: (!(("wasm32" == target."arch" or null) && (("unknown" == target."os" or null) || ("none" == target."os" or null)))); features = [ "http1" "http2" "client" "server" ]; } { name = "hyper-util"; packageId = "hyper-util"; - target = { target, features }: (!("wasm32" == target."arch" or null)); + target = { target, features }: (!(("wasm32" == target."arch" or null) && (("unknown" == target."os" or null) || ("none" == target."os" or null)))); features = [ "http1" "http2" "client" "client-legacy" "server-auto" "server-graceful" "tokio" ]; } - { - name = "serde"; - packageId = "serde"; - target = { target, features }: (!("wasm32" == target."arch" or null)); - features = [ "derive" ]; - } { name = "tokio"; packageId = "tokio"; usesDefaultFeatures = false; - target = { target, features }: (!("wasm32" == target."arch" or null)); + target = { target, features }: (!(("wasm32" == target."arch" or null) && (("unknown" == target."os" or null) || ("none" == target."os" or null)))); features = [ "macros" "rt-multi-thread" ]; } { @@ -7947,40 +7963,37 @@ rec { { name = "wasm-bindgen"; packageId = "wasm-bindgen"; - target = { target, features }: ("wasm32" == target."arch" or null); + target = { target, features }: (("wasm32" == target."arch" or null) && (("unknown" == target."os" or null) || ("none" == target."os" or null))); features = [ "serde-serialize" ]; } ]; features = { + "__native-tls" = [ "dep:hyper-tls" "dep:native-tls-crate" "__tls" "dep:tokio-native-tls" ]; + "__native-tls-alpn" = [ "native-tls-crate?/alpn" "hyper-tls?/alpn" ]; "__rustls" = [ "dep:hyper-rustls" "dep:tokio-rustls" "dep:rustls" "__tls" ]; - "__rustls-ring" = [ "hyper-rustls?/ring" "tokio-rustls?/ring" "rustls?/ring" "quinn?/ring" ]; + "__rustls-aws-lc-rs" = [ "hyper-rustls?/aws-lc-rs" "tokio-rustls?/aws-lc-rs" "rustls?/aws-lc-rs" "quinn?/rustls-aws-lc-rs" ]; "__tls" = [ "dep:rustls-pki-types" "tokio/io-util" ]; "blocking" = [ "dep:futures-channel" "futures-channel?/sink" "dep:futures-util" "futures-util?/io" "futures-util?/sink" "tokio/sync" ]; "brotli" = [ "tower-http/decompression-br" ]; "charset" = [ "dep:encoding_rs" "dep:mime" ]; "cookies" = [ "dep:cookie_crate" "dep:cookie_store" ]; "default" = [ "default-tls" "charset" "http2" "system-proxy" ]; - "default-tls" = [ "dep:hyper-tls" "dep:native-tls-crate" "__tls" "dep:tokio-native-tls" ]; + "default-tls" = [ "rustls" ]; "deflate" = [ "tower-http/decompression-deflate" ]; + "form" = [ "dep:serde" "dep:serde_urlencoded" ]; "gzip" = [ "tower-http/decompression-gzip" ]; - "h2" = [ "dep:h2" ]; "hickory-dns" = [ "dep:hickory-resolver" "dep:once_cell" ]; - "http2" = [ "h2" "hyper/http2" "hyper-util/http2" "hyper-rustls?/http2" ]; - "http3" = [ "rustls-tls-manual-roots" "dep:h3" "dep:h3-quinn" "dep:quinn" "tokio/macros" ]; - "json" = [ "dep:serde_json" ]; - "macos-system-configuration" = [ "system-proxy" ]; + "http2" = [ "dep:h2" "hyper/http2" "hyper-util/http2" "hyper-rustls?/http2" ]; + "http3" = [ "rustls" "dep:h3" "dep:h3-quinn" "dep:quinn" "tokio/macros" ]; + "json" = [ "dep:serde" "dep:serde_json" ]; "multipart" = [ "dep:mime_guess" "dep:futures-util" ]; - "native-tls" = [ "default-tls" ]; - "native-tls-alpn" = [ "native-tls" "native-tls-crate?/alpn" "hyper-tls?/alpn" ]; - "native-tls-vendored" = [ "native-tls" "native-tls-crate?/vendored" ]; - "rustls-tls" = [ "rustls-tls-webpki-roots" ]; - "rustls-tls-manual-roots" = [ "rustls-tls-manual-roots-no-provider" "__rustls-ring" ]; - "rustls-tls-manual-roots-no-provider" = [ "__rustls" ]; - "rustls-tls-native-roots" = [ "rustls-tls-native-roots-no-provider" "__rustls-ring" ]; - "rustls-tls-native-roots-no-provider" = [ "dep:rustls-native-certs" "hyper-rustls?/native-tokio" "__rustls" ]; - "rustls-tls-no-provider" = [ "rustls-tls-manual-roots-no-provider" ]; - "rustls-tls-webpki-roots" = [ "rustls-tls-webpki-roots-no-provider" "__rustls-ring" ]; - "rustls-tls-webpki-roots-no-provider" = [ "dep:webpki-roots" "hyper-rustls?/webpki-tokio" "__rustls" ]; + "native-tls" = [ "__native-tls" "__native-tls-alpn" ]; + "native-tls-no-alpn" = [ "__native-tls" ]; + "native-tls-vendored" = [ "__native-tls" "native-tls-crate?/vendored" "__native-tls-alpn" ]; + "native-tls-vendored-no-alpn" = [ "__native-tls" "native-tls-crate?/vendored" ]; + "query" = [ "dep:serde" "dep:serde_urlencoded" ]; + "rustls" = [ "__rustls-aws-lc-rs" "dep:rustls-platform-verifier" "__rustls" ]; + "rustls-no-provider" = [ "dep:rustls-platform-verifier" "__rustls" ]; "stream" = [ "tokio/fs" "dep:futures-util" "dep:tokio-util" "dep:wasm-streams" ]; "system-proxy" = [ "hyper-util/client-proxy-system" ]; "zstd" = [ "tower-http/decompression-zstd" ]; @@ -9354,11 +9367,11 @@ rec { }; resolvedDefaultFeatures = [ "alloc" "default" "rust_1_61" "rust_1_65" "std" ]; }; - "snafu 0.9.0" = rec { + "snafu 0.9.1" = rec { crateName = "snafu"; - version = "0.9.0"; + version = "0.9.1"; edition = "2018"; - sha256 = "1ii9r99x5qcn754m624yzgb9hzvkqkrcygf0aqh0pyb9dbnvrm6i"; + sha256 = "08k5yfydxdlshivfhrdq9km8qn02r93q28gkyvazbqz2icr1586i"; authors = [ "Jake Goulding " ]; @@ -9366,7 +9379,6 @@ rec { { name = "futures-core"; packageId = "futures-core"; - rename = "futures-core-crate"; optional = true; usesDefaultFeatures = false; } @@ -9378,22 +9390,18 @@ rec { } { name = "snafu-derive"; - packageId = "snafu-derive 0.9.0"; + packageId = "snafu-derive 0.9.1"; } ]; features = { - "backtrace" = [ "dep:backtrace" ]; - "backtraces-impl-backtrace-crate" = [ "backtrace" ]; + "backtraces-impl-backtrace-crate" = [ "dep:backtrace" ]; "default" = [ "std" "rust_1_81" ]; - "futures" = [ "futures-core-crate" "pin-project" ]; - "futures-core-crate" = [ "dep:futures-core-crate" ]; - "futures-crate" = [ "dep:futures-crate" ]; - "internal-dev-dependencies" = [ "futures-crate" ]; - "pin-project" = [ "dep:pin-project" ]; + "futures" = [ "dep:futures-core" "dep:pin-project" ]; + "internal-dev-dependencies" = [ "dep:futures" ]; "std" = [ "alloc" ]; "unstable-provider-api" = [ "snafu-derive/unstable-provider-api" ]; }; - resolvedDefaultFeatures = [ "alloc" "default" "futures" "futures-core-crate" "pin-project" "rust_1_81" "std" ]; + resolvedDefaultFeatures = [ "alloc" "default" "futures" "rust_1_81" "std" ]; }; "snafu-derive 0.6.10" = rec { crateName = "snafu-derive"; @@ -9457,11 +9465,11 @@ rec { }; resolvedDefaultFeatures = [ "rust_1_61" ]; }; - "snafu-derive 0.9.0" = rec { + "snafu-derive 0.9.1" = rec { crateName = "snafu-derive"; - version = "0.9.0"; + version = "0.9.1"; edition = "2018"; - sha256 = "0h0x61kyj4fvilcr2nj02l85shw1ika64vq9brf2gyna662ln9al"; + sha256 = "1nkfi7bis72pz3w7vb64m79w49qsv20sbf19jkd471vbhr83q42z"; procMacro = true; libName = "snafu_derive"; authors = [ @@ -9487,7 +9495,7 @@ rec { name = "syn"; packageId = "syn 2.0.117"; usesDefaultFeatures = false; - features = [ "clone-impls" "derive" "full" "parsing" "printing" "proc-macro" ]; + features = [ "clone-impls" "derive" "full" "parsing" "printing" "proc-macro" "visit-mut" ]; } ]; features = { @@ -9595,9 +9603,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech/operator-rs.git"; - rev = "7a5f0c3fbcd091340214a23f0607fcd4b4fcc152"; - sha256 = "0lj969rjbxairjglrnaq0xhabvdrq5nd6wl1i0y9pr50nhh7zvgk"; + url = "https://github.com/stackabletech//operator-rs.git"; + rev = "f3a0923138059bfdfe1bb7115341c85187167e86"; + sha256 = "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x"; }; libName = "stackable_certs"; authors = [ @@ -9655,7 +9663,7 @@ rec { } { name = "snafu"; - packageId = "snafu 0.9.0"; + packageId = "snafu 0.9.1"; } { name = "stackable-shared"; @@ -9741,7 +9749,7 @@ rec { } { name = "snafu"; - packageId = "snafu 0.9.0"; + packageId = "snafu 0.9.1"; features = [ "futures" ]; } { @@ -9784,8 +9792,15 @@ rec { name = "rstest"; packageId = "rstest"; } + { + name = "stackable-operator"; + packageId = "stackable-operator"; + features = [ "webhook" "test-support" ]; + } ]; - + features = { + }; + resolvedDefaultFeatures = [ "test-support" ]; }; "stackable-operator" = rec { crateName = "stackable-operator"; @@ -9793,9 +9808,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech/operator-rs.git"; - rev = "7a5f0c3fbcd091340214a23f0607fcd4b4fcc152"; - sha256 = "0lj969rjbxairjglrnaq0xhabvdrq5nd6wl1i0y9pr50nhh7zvgk"; + url = "https://github.com/stackabletech//operator-rs.git"; + rev = "f3a0923138059bfdfe1bb7115341c85187167e86"; + sha256 = "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x"; }; libName = "stackable_operator"; authors = [ @@ -9845,6 +9860,10 @@ rec { name = "indexmap"; packageId = "indexmap"; } + { + name = "java-properties"; + packageId = "java-properties"; + } { name = "jiff"; packageId = "jiff"; @@ -9852,6 +9871,7 @@ rec { { name = "json-patch"; packageId = "json-patch"; + features = [ "schemars" ]; } { name = "k8s-openapi"; @@ -9899,9 +9919,14 @@ rec { name = "serde_yaml"; packageId = "serde_yaml"; } + { + name = "sha2"; + packageId = "sha2"; + features = [ "oid" ]; + } { name = "snafu"; - packageId = "snafu 0.9.0"; + packageId = "snafu 0.9.1"; } { name = "stackable-operator-derive"; @@ -9955,17 +9980,26 @@ rec { packageId = "url"; features = [ "serde" ]; } + { + name = "uuid"; + packageId = "uuid"; + } + { + name = "xml"; + packageId = "xml"; + } ]; features = { "certs" = [ "dep:stackable-certs" ]; + "client-feature-gates" = [ "dep:winnow" ]; "crds" = [ "dep:stackable-versioned" ]; "default" = [ "crds" ]; - "full" = [ "crds" "certs" "time" "webhook" "kube-ws" ]; + "full" = [ "client-feature-gates" "crds" "certs" "test-support" "time" "webhook" "kube-ws" ]; "kube-ws" = [ "kube/ws" ]; "time" = [ "stackable-shared/time" ]; "webhook" = [ "dep:stackable-webhook" ]; }; - resolvedDefaultFeatures = [ "crds" "default" "webhook" ]; + resolvedDefaultFeatures = [ "crds" "default" "test-support" "webhook" ]; }; "stackable-operator-derive" = rec { crateName = "stackable-operator-derive"; @@ -9973,9 +10007,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech/operator-rs.git"; - rev = "7a5f0c3fbcd091340214a23f0607fcd4b4fcc152"; - sha256 = "0lj969rjbxairjglrnaq0xhabvdrq5nd6wl1i0y9pr50nhh7zvgk"; + url = "https://github.com/stackabletech//operator-rs.git"; + rev = "f3a0923138059bfdfe1bb7115341c85187167e86"; + sha256 = "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x"; }; procMacro = true; libName = "stackable_operator_derive"; @@ -10004,13 +10038,13 @@ rec { }; "stackable-shared" = rec { crateName = "stackable-shared"; - version = "0.1.0"; + version = "0.1.1"; edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech/operator-rs.git"; - rev = "7a5f0c3fbcd091340214a23f0607fcd4b4fcc152"; - sha256 = "0lj969rjbxairjglrnaq0xhabvdrq5nd6wl1i0y9pr50nhh7zvgk"; + url = "https://github.com/stackabletech//operator-rs.git"; + rev = "f3a0923138059bfdfe1bb7115341c85187167e86"; + sha256 = "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x"; }; libName = "stackable_shared"; authors = [ @@ -10054,7 +10088,7 @@ rec { } { name = "snafu"; - packageId = "snafu 0.9.0"; + packageId = "snafu 0.9.1"; } { name = "strum"; @@ -10085,13 +10119,13 @@ rec { }; "stackable-telemetry" = rec { crateName = "stackable-telemetry"; - version = "0.6.3"; + version = "0.6.4"; edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech/operator-rs.git"; - rev = "7a5f0c3fbcd091340214a23f0607fcd4b4fcc152"; - sha256 = "0lj969rjbxairjglrnaq0xhabvdrq5nd6wl1i0y9pr50nhh7zvgk"; + url = "https://github.com/stackabletech//operator-rs.git"; + rev = "f3a0923138059bfdfe1bb7115341c85187167e86"; + sha256 = "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x"; }; libName = "stackable_telemetry"; authors = [ @@ -10134,7 +10168,7 @@ rec { { name = "opentelemetry_sdk"; packageId = "opentelemetry_sdk"; - features = [ "rt-tokio" "logs" "rt-tokio" "spec_unstable_logs_enabled" ]; + features = [ "rt-tokio" "logs" "rt-tokio" ]; } { name = "pin-project"; @@ -10142,7 +10176,7 @@ rec { } { name = "snafu"; - packageId = "snafu 0.9.0"; + packageId = "snafu 0.9.1"; } { name = "strum"; @@ -10199,9 +10233,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech/operator-rs.git"; - rev = "7a5f0c3fbcd091340214a23f0607fcd4b4fcc152"; - sha256 = "0lj969rjbxairjglrnaq0xhabvdrq5nd6wl1i0y9pr50nhh7zvgk"; + url = "https://github.com/stackabletech//operator-rs.git"; + rev = "f3a0923138059bfdfe1bb7115341c85187167e86"; + sha256 = "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x"; }; libName = "stackable_versioned"; authors = [ @@ -10234,7 +10268,7 @@ rec { } { name = "snafu"; - packageId = "snafu 0.9.0"; + packageId = "snafu 0.9.1"; } { name = "stackable-versioned-macros"; @@ -10249,9 +10283,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech/operator-rs.git"; - rev = "7a5f0c3fbcd091340214a23f0607fcd4b4fcc152"; - sha256 = "0lj969rjbxairjglrnaq0xhabvdrq5nd6wl1i0y9pr50nhh7zvgk"; + url = "https://github.com/stackabletech//operator-rs.git"; + rev = "f3a0923138059bfdfe1bb7115341c85187167e86"; + sha256 = "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x"; }; procMacro = true; libName = "stackable_versioned_macros"; @@ -10317,9 +10351,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech/operator-rs.git"; - rev = "7a5f0c3fbcd091340214a23f0607fcd4b4fcc152"; - sha256 = "0lj969rjbxairjglrnaq0xhabvdrq5nd6wl1i0y9pr50nhh7zvgk"; + url = "https://github.com/stackabletech//operator-rs.git"; + rev = "f3a0923138059bfdfe1bb7115341c85187167e86"; + sha256 = "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x"; }; libName = "stackable_webhook"; authors = [ @@ -10391,7 +10425,7 @@ rec { } { name = "snafu"; - packageId = "snafu 0.9.0"; + packageId = "snafu 0.9.1"; } { name = "stackable-certs"; @@ -11482,6 +11516,33 @@ rec { } ]; + }; + "tonic-types" = rec { + crateName = "tonic-types"; + version = "0.14.5"; + edition = "2021"; + sha256 = "16bk1cxi2m0xgaabf98nnj7dn9j16ymkh27jq4s3shjm4a85m1ra"; + libName = "tonic_types"; + authors = [ + "Lucio Franco " + "Rafael Lemos " + ]; + dependencies = [ + { + name = "prost"; + packageId = "prost"; + } + { + name = "prost-types"; + packageId = "prost-types"; + } + { + name = "tonic"; + packageId = "tonic"; + usesDefaultFeatures = false; + } + ]; + }; "tower" = rec { crateName = "tower"; @@ -11938,9 +11999,9 @@ rec { }; "tracing-opentelemetry" = rec { crateName = "tracing-opentelemetry"; - version = "0.32.1"; + version = "0.33.0"; edition = "2021"; - sha256 = "1z2jjmxbkm1qawlb3bm99x8xwf4g8wjkbcknm9z4fv1w14nqzhhs"; + sha256 = "09nvxy5m7nxmifz4b6szdcyczapp2jcgxcac0jw4ax8klz5n9g5d"; libName = "tracing_opentelemetry"; dependencies = [ { @@ -14059,9 +14120,9 @@ rec { }; "xml" = rec { crateName = "xml"; - version = "1.2.1"; + version = "1.3.0"; edition = "2021"; - sha256 = "0ak4k990faralbli5a0rb8kvwihccb2rp0r94d4azfy94a6lkamq"; + sha256 = "128s58qhq8whrx90zbw8r5algr7lakgbf7mn05jfk234rbjqavv3"; authors = [ "Vladimir Matveev " "Kornel (https://github.com/kornelski)" diff --git a/Cargo.toml b/Cargo.toml index 91d645f1..e18abb19 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,4 +29,4 @@ tracing = "0.1" uuid = "1.18" [patch."https://github.com/stackabletech/operator-rs"] -# stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "main" } +stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "smooth-operator" } diff --git a/crate-hashes.json b/crate-hashes.json index 86f2b840..7ea4be27 100644 --- a/crate-hashes.json +++ b/crate-hashes.json @@ -1,12 +1,12 @@ { - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#k8s-version@0.1.3": "0lj969rjbxairjglrnaq0xhabvdrq5nd6wl1i0y9pr50nhh7zvgk", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#stackable-certs@0.4.0": "0lj969rjbxairjglrnaq0xhabvdrq5nd6wl1i0y9pr50nhh7zvgk", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#stackable-operator-derive@0.3.1": "0lj969rjbxairjglrnaq0xhabvdrq5nd6wl1i0y9pr50nhh7zvgk", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#stackable-operator@0.111.1": "0lj969rjbxairjglrnaq0xhabvdrq5nd6wl1i0y9pr50nhh7zvgk", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#stackable-shared@0.1.0": "0lj969rjbxairjglrnaq0xhabvdrq5nd6wl1i0y9pr50nhh7zvgk", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#stackable-telemetry@0.6.3": "0lj969rjbxairjglrnaq0xhabvdrq5nd6wl1i0y9pr50nhh7zvgk", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#stackable-versioned-macros@0.10.0": "0lj969rjbxairjglrnaq0xhabvdrq5nd6wl1i0y9pr50nhh7zvgk", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#stackable-versioned@0.10.0": "0lj969rjbxairjglrnaq0xhabvdrq5nd6wl1i0y9pr50nhh7zvgk", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#stackable-webhook@0.9.1": "0lj969rjbxairjglrnaq0xhabvdrq5nd6wl1i0y9pr50nhh7zvgk", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#k8s-version@0.1.3": "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-certs@0.4.0": "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-operator-derive@0.3.1": "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-operator@0.111.1": "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-shared@0.1.1": "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-telemetry@0.6.4": "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-versioned-macros@0.10.0": "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-versioned@0.10.0": "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-webhook@0.9.1": "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x", "git+https://github.com/stackabletech/product-config.git?tag=0.8.0#product-config@0.8.0": "1dz70kapm2wdqcr7ndyjji0lhsl98bsq95gnb2lw487wf6yr7987" } \ No newline at end of file diff --git a/extra/crds.yaml b/extra/crds.yaml index f73fdda8..10719767 100644 --- a/extra/crds.yaml +++ b/extra/crds.yaml @@ -234,7 +234,7 @@ spec: managingRoleGroup: default: security-config description: The role group that updates the security index if any setting is managed by the operator. - maxLength: 16 + maxLength: 63 minLength: 1 type: string settings: @@ -1885,31 +1885,39 @@ spec: Example for key-value pairs: - stringProperty: new value - booleanProperty: "true" + ```yaml + stringProperty: new value + booleanProperty: "true" + ``` Example for a JSON merge patch: - jsonMergePatch: - stringProperty: new value - booleanProperty: true - nestedProperty: - key: value + ```yaml + jsonMergePatch: + stringProperty: new value + booleanProperty: true + nestedProperty: + key: value + ``` Example for a JSON patch: - jsonPatch: - - op: replace - path: /stringProperty - value: new value + ```yaml + jsonPatch: + - op: replace + path: /stringProperty + value: new value + ``` Example for a JSON object: - userProvided: - stringProperty: new value - booleanProperty: true - nestedProperty: - key: value + ```yaml + userProvided: + stringProperty: new value + booleanProperty: true + nestedProperty: + key: value + ``` type: object x-kubernetes-preserve-unknown-fields: true type: object @@ -2608,31 +2616,39 @@ spec: Example for key-value pairs: - stringProperty: new value - booleanProperty: "true" + ```yaml + stringProperty: new value + booleanProperty: "true" + ``` Example for a JSON merge patch: - jsonMergePatch: - stringProperty: new value - booleanProperty: true - nestedProperty: - key: value + ```yaml + jsonMergePatch: + stringProperty: new value + booleanProperty: true + nestedProperty: + key: value + ``` Example for a JSON patch: - jsonPatch: - - op: replace - path: /stringProperty - value: new value + ```yaml + jsonPatch: + - op: replace + path: /stringProperty + value: new value + ``` Example for a JSON object: - userProvided: - stringProperty: new value - booleanProperty: true - nestedProperty: - key: value + ```yaml + userProvided: + stringProperty: new value + booleanProperty: true + nestedProperty: + key: value + ``` type: object x-kubernetes-preserve-unknown-fields: true type: object diff --git a/rust/operator-binary/Cargo.toml b/rust/operator-binary/Cargo.toml index 6a23107e..4215b09d 100644 --- a/rust/operator-binary/Cargo.toml +++ b/rust/operator-binary/Cargo.toml @@ -9,6 +9,12 @@ repository.workspace = true publish = false build = "build.rs" +[features] +# The macro attributed_string_type is used in this operator. It produces test +# code if the feature "test-support" is set. This feature is defined here to +# suppress a Clippy warning. +test-support = [] + [dependencies] stackable-operator.workspace = true @@ -31,3 +37,4 @@ built.workspace = true [dev-dependencies] pretty_assertions.workspace = true rstest.workspace = true +stackable-operator = { workspace = true, features = ["test-support"] } diff --git a/rust/operator-binary/src/controller.rs b/rust/operator-binary/src/controller.rs index b6c65f87..15e431e2 100644 --- a/rust/operator-binary/src/controller.rs +++ b/rust/operator-binary/src/controller.rs @@ -31,15 +31,7 @@ use stackable_operator::{ kube::{Resource, api::ObjectMeta, core::DeserializeGuard, runtime::controller::Action}, logging::controller::ReconcilerError, shared::time::Duration, -}; -use strum::{Display, EnumDiscriminants, EnumIter, IntoStaticStr}; -use update_status::update_status; -use validate::validate; - -use crate::{ - controller::preprocess::preprocess, - crd::v1alpha1, - framework::{ + v2::{ HasName, HasUid, NameIsValidLabelValue, config_overrides::JsonConfigOverrides, product_logging::framework::{ValidatedContainerLogConfigChoice, VectorContainerLogConfig}, @@ -54,6 +46,11 @@ use crate::{ }, }, }; +use strum::{Display, EnumDiscriminants, EnumIter, IntoStaticStr}; +use update_status::update_status; +use validate::validate; + +use crate::{controller::preprocess::preprocess, crd::v1alpha1}; mod apply; mod build; @@ -160,6 +157,13 @@ type OpenSearchRoleGroupConfig = RoleGroupConfig< ValidatedOpenSearchConfigOverrides, >; +/// Returns the replication count for the given role group config +/// +/// Returns 1 if not set, as this is the Kubernetes default. +pub fn replicas(role_group_config: &OpenSearchRoleGroupConfig) -> u16 { + role_group_config.replicas.unwrap_or(1) +} + type OpenSearchNodeResources = stackable_operator::commons::resources::Resources; @@ -313,11 +317,8 @@ impl ValidatedCluster { } /// Returns the sum of the replicas in all role-groups - pub fn node_count(&self) -> u32 { - self.role_group_configs - .values() - .map(|rg| rg.replicas as u32) - .sum() + pub fn node_count(&self) -> u16 { + self.role_group_configs.values().map(replicas).sum() } /// Returns all role-group configurations which contain the given node role @@ -516,6 +517,15 @@ mod tests { kvp::LabelValue, product_logging::spec::AutomaticContainerLogConfig, shared::time::Duration, + v2::{ + builder::pod::container::EnvVarSet, + product_logging::framework::ValidatedContainerLogConfigChoice, + role_utils::GenericCommonConfig, + types::{ + kubernetes::{ListenerClassName, NamespaceName, SecretClassName}, + operator::{ClusterName, OperatorName, ProductVersion, RoleGroupName}, + }, + }, }; use uuid::uuid; @@ -526,15 +536,6 @@ mod tests { ValidatedOpenSearchConfig, ValidatedOpenSearchConfigOverrides, ValidatedSecurity, }, crd::v1alpha1, - framework::{ - builder::pod::container::EnvVarSet, - product_logging::framework::ValidatedContainerLogConfigChoice, - role_utils::GenericCommonConfig, - types::{ - kubernetes::{ListenerClassName, NamespaceName, SecretClassName}, - operator::{ClusterName, OperatorName, ProductVersion, RoleGroupName}, - }, - }, }; #[test] @@ -662,7 +663,7 @@ mod tests { node_roles: impl Into, ) -> OpenSearchRoleGroupConfig { OpenSearchRoleGroupConfig { - replicas, + replicas: Some(replicas), config: ValidatedOpenSearchConfig { affinity: StackableAffinity::default(), discovery_service_exposed: true, diff --git a/rust/operator-binary/src/controller/apply.rs b/rust/operator-binary/src/controller/apply.rs index a524117c..b8029b53 100644 --- a/rust/operator-binary/src/controller/apply.rs +++ b/rust/operator-binary/src/controller/apply.rs @@ -7,17 +7,17 @@ use stackable_operator::{ client::Client, cluster_resources::{ClusterResource, ClusterResourceApplyStrategy, ClusterResources}, deep_merger::ObjectOverrides, + v2::{ + cluster_resources::cluster_resources_new, + types::{ + kubernetes::{NamespaceName, Uid}, + operator::ClusterName, + }, + }, }; use strum::{EnumDiscriminants, IntoStaticStr}; use super::{Applied, ContextNames, KubernetesResources, Prepared}; -use crate::framework::{ - cluster_resources::cluster_resources_new, - types::{ - kubernetes::{NamespaceName, Uid}, - operator::ClusterName, - }, -}; #[derive(Snafu, Debug, EnumDiscriminants)] #[strum_discriminants(derive(IntoStaticStr))] diff --git a/rust/operator-binary/src/controller/build.rs b/rust/operator-binary/src/controller/build.rs index 6f374bf0..26f8c9ec 100644 --- a/rust/operator-binary/src/controller/build.rs +++ b/rust/operator-binary/src/controller/build.rs @@ -74,6 +74,18 @@ mod tests { kvp::LabelValue, product_logging::spec::AutomaticContainerLogConfig, shared::time::Duration, + v2::{ + builder::pod::container::EnvVarSet, + role_utils::GenericCommonConfig, + types::{ + common::Port, + kubernetes::{Hostname, ListenerClassName, NamespaceName, SecretClassName}, + operator::{ + ClusterName, ControllerName, OperatorName, ProductName, ProductVersion, + RoleGroupName, + }, + }, + }, }; use uuid::uuid; @@ -86,18 +98,6 @@ mod tests { ValidatedOpenSearchConfigOverrides, ValidatedSecurity, }, crd::v1alpha1, - framework::{ - builder::pod::container::EnvVarSet, - role_utils::GenericCommonConfig, - types::{ - common::Port, - kubernetes::{Hostname, ListenerClassName, NamespaceName, SecretClassName}, - operator::{ - ClusterName, ControllerName, OperatorName, ProductName, ProductVersion, - RoleGroupName, - }, - }, - }, }; #[test] @@ -229,7 +229,7 @@ mod tests { node_roles: impl Into, ) -> OpenSearchRoleGroupConfig { OpenSearchRoleGroupConfig { - replicas, + replicas: Some(replicas), config: ValidatedOpenSearchConfig { affinity: StackableAffinity::default(), discovery_service_exposed: true, diff --git a/rust/operator-binary/src/controller/build/node_config.rs b/rust/operator-binary/src/controller/build/node_config.rs index 8a6805dc..cd2d20cb 100644 --- a/rust/operator-binary/src/controller/build/node_config.rs +++ b/rust/operator-binary/src/controller/build/node_config.rs @@ -2,24 +2,25 @@ use serde_json::json; use stackable_operator::{ - builder::pod::container::FieldPathEnvVar, commons::networking::DomainName, + builder::pod::container::FieldPathEnvVar, + commons::networking::DomainName, k8s_openapi::DeepMerge, + v2::{ + builder::pod::container::{EnvVarName, EnvVarSet}, + config_overrides::JsonConfigOverrides, + product_logging::framework::STACKABLE_LOG_DIR, + role_group_utils, + types::{kubernetes::ServiceName, operator::RoleGroupName}, + }, }; use super::ValidatedCluster; use crate::{ controller::{ OpenSearchRoleGroupConfig, ValidatedNodeRole, - build::role_group_builder::RoleGroupSecurityMode, + build::role_group_builder::RoleGroupSecurityMode, replicas, }, crd::v1alpha1, - framework::{ - builder::pod::container::{EnvVarName, EnvVarSet}, - config_overrides::JsonConfigOverrides, - product_logging::framework::STACKABLE_LOG_DIR, - role_group_utils, - types::{kubernetes::ServiceName, operator::RoleGroupName}, - }, }; /// The main configuration file of OpenSearch @@ -295,13 +296,13 @@ impl NodeConfig { // Prefix with an underscore, so that it occurs before the other environment // variables which depend on it. &EnvVarName::from_str_unsafe("_POD_NAME"), - FieldPathEnvVar::Name, + &FieldPathEnvVar::Name, ) // Set the OpenSearch node name to the Pod name. // The node name is used e.g. for INITIAL_CLUSTER_MANAGER_NODES. .with_field_path( &EnvVarName::from_str_unsafe(CONFIG_OPTION_NODE_NAME), - FieldPathEnvVar::Name, + &FieldPathEnvVar::Name, ) .with_value( &EnvVarName::from_str_unsafe(CONFIG_OPTION_NETWORK_PUBLISH_HOST), @@ -443,7 +444,7 @@ impl NodeConfig { }; pod_names.extend( - (0..role_group_config.replicas) + (0..replicas(&role_group_config)) .map(|i| format!("{}-{i}", role_group_resource_names.stateful_set_name())), ); } @@ -495,6 +496,16 @@ mod tests { kvp::LabelValue, product_logging::spec::AutomaticContainerLogConfig, shared::time::Duration, + v2::{ + product_logging::framework::ValidatedContainerLogConfigChoice, + role_utils::GenericCommonConfig, + types::{ + kubernetes::{ + ConfigMapKey, ConfigMapName, ListenerClassName, NamespaceName, SecretClassName, + }, + operator::{ClusterName, ProductVersion}, + }, + }, }; use uuid::uuid; @@ -505,16 +516,6 @@ mod tests { ValidatedSecurity, }, crd::v1alpha1, - framework::{ - product_logging::framework::ValidatedContainerLogConfigChoice, - role_utils::GenericCommonConfig, - types::{ - kubernetes::{ - ConfigMapKey, ConfigMapName, ListenerClassName, NamespaceName, SecretClassName, - }, - operator::{ClusterName, ProductVersion, RoleGroupName}, - }, - }, }; struct TestConfig { @@ -540,7 +541,7 @@ mod tests { let role_group_name = RoleGroupName::from_str_unsafe("data"); let role_group_config = OpenSearchRoleGroupConfig { - replicas: test_config.replicas, + replicas: Some(test_config.replicas), config: ValidatedOpenSearchConfig { affinity: StackableAffinity::default(), discovery_service_exposed: true, @@ -704,7 +705,7 @@ mod tests { .with_value(&EnvVarName::from_str_unsafe("TEST"), "value") .with_field_path( &EnvVarName::from_str_unsafe("_POD_NAME"), - FieldPathEnvVar::Name + &FieldPathEnvVar::Name ) .with_value( &EnvVarName::from_str_unsafe("cluster.initial_cluster_manager_nodes"), @@ -724,7 +725,7 @@ mod tests { ) .with_field_path( &EnvVarName::from_str_unsafe("node.name"), - FieldPathEnvVar::Name + &FieldPathEnvVar::Name ) .with_value( &EnvVarName::from_str_unsafe("node.roles"), diff --git a/rust/operator-binary/src/controller/build/product_logging/config.rs b/rust/operator-binary/src/controller/build/product_logging/config.rs index edc3e964..6ef44d83 100644 --- a/rust/operator-binary/src/controller/build/product_logging/config.rs +++ b/rust/operator-binary/src/controller/build/product_logging/config.rs @@ -5,16 +5,14 @@ use std::{cmp, collections::BTreeMap}; use stackable_operator::{ memory::{BinaryMultiple, MemoryQuantity}, product_logging::spec::{AppenderConfig, AutomaticContainerLogConfig, LogLevel, LoggerConfig}, -}; - -use crate::{ - crd::v1alpha1::{self}, - framework::{ + v2::{ builder::pod::container::{EnvVarName, EnvVarSet}, product_logging::framework::STACKABLE_LOG_DIR, }, }; +use crate::crd::v1alpha1::{self}; + /// OpenSearch log configuration file pub const CONFIGURATION_FILE_LOG4J2_PROPERTIES: &str = "log4j2.properties"; diff --git a/rust/operator-binary/src/controller/build/role_builder.rs b/rust/operator-binary/src/controller/build/role_builder.rs index 95979e07..45b8c6a9 100644 --- a/rust/operator-binary/src/controller/build/role_builder.rs +++ b/rust/operator-binary/src/controller/build/role_builder.rs @@ -18,15 +18,7 @@ use stackable_operator::{ Label, Labels, consts::{STACKABLE_VENDOR_KEY, STACKABLE_VENDOR_VALUE}, }, -}; - -use crate::{ - controller::{ - ContextNames, HTTP_PORT, HTTP_PORT_NAME, TRANSPORT_PORT, TRANSPORT_PORT_NAME, - ValidatedCluster, ValidatedSecurity, build::role_group_builder::RoleGroupBuilder, - }, - crd::v1alpha1, - framework::{ + v2::{ NameIsValidLabelValue, builder::{ meta::ownerreference_from_resource, pdb::pod_disruption_budget_builder_with_role, @@ -39,6 +31,14 @@ use crate::{ }, }; +use crate::{ + controller::{ + ContextNames, HTTP_PORT, HTTP_PORT_NAME, TRANSPORT_PORT, TRANSPORT_PORT_NAME, + ValidatedCluster, ValidatedSecurity, build::role_group_builder::RoleGroupBuilder, + }, + crd::v1alpha1, +}; + const PDB_DEFAULT_MAX_UNAVAILABLE: u16 = 1; /// Builder for role resources @@ -379,6 +379,21 @@ mod tests { kvp::LabelValue, product_logging::spec::AutomaticContainerLogConfig, shared::time::Duration, + v2::{ + builder::pod::container::EnvVarSet, + role_utils::GenericCommonConfig, + types::{ + common::Port, + kubernetes::{ + ConfigMapName, Hostname, ListenerClassName, ListenerName, NamespaceName, + SecretClassName, ServiceName, + }, + operator::{ + ClusterName, ControllerName, OperatorName, ProductName, ProductVersion, + RoleGroupName, + }, + }, + }, }; use uuid::uuid; @@ -394,21 +409,6 @@ mod tests { }, }, crd::v1alpha1, - framework::{ - builder::pod::container::EnvVarSet, - role_utils::GenericCommonConfig, - types::{ - common::Port, - kubernetes::{ - ConfigMapName, Hostname, ListenerClassName, ListenerName, NamespaceName, - SecretClassName, ServiceName, - }, - operator::{ - ClusterName, ControllerName, OperatorName, ProductName, ProductVersion, - RoleGroupName, - }, - }, - }, }; fn context_names() -> ContextNames { @@ -426,7 +426,7 @@ mod tests { .expect("should be a valid ProductImage"); let role_group_config = OpenSearchRoleGroupConfig { - replicas: 1, + replicas: Some(1), config: ValidatedOpenSearchConfig { affinity: StackableAffinity::default(), discovery_service_exposed: true, diff --git a/rust/operator-binary/src/controller/build/role_group_builder.rs b/rust/operator-binary/src/controller/build/role_group_builder.rs index 9273ecc4..9f311752 100644 --- a/rust/operator-binary/src/controller/build/role_group_builder.rs +++ b/rust/operator-binary/src/controller/build/role_group_builder.rs @@ -17,6 +17,7 @@ use stackable_operator::{ resources::{CpuLimits, MemoryLimits, Resources}, secret_class::SecretClassVolumeProvisionParts, }, + constant, constants::RESTART_CONTROLLER_ENABLED_LABEL, crd::listener::{self}, k8s_openapi::{ @@ -40,28 +41,7 @@ use stackable_operator::{ remove_vector_shutdown_file_command, }, utils::COMMON_BASH_TRAP_FUNCTIONS, -}; - -use super::{ - node_config::{CONFIGURATION_FILE_OPENSEARCH_YML, NodeConfig}, - product_logging::config::{ - CONFIGURATION_FILE_LOG4J2_PROPERTIES, create_log4j2_config, vector_config_file_content, - }, -}; -use crate::{ - constant, - controller::{ - ContextNames, HTTP_PORT, HTTP_PORT_NAME, OpenSearchRoleGroupConfig, TRANSPORT_PORT, - TRANSPORT_PORT_NAME, ValidatedCluster, ValidatedNodeRole, ValidatedSecurity, - build::{ - product_logging::config::{ - MAX_OPENSEARCH_SERVER_LOG_FILES_SIZE, vector_config_file_extra_env_vars, - }, - role_builder::security_config_map_name, - }, - }, - crd::{ExtendedSecuritySettingsFileType, v1alpha1}, - framework::{ + v2::{ builder::{ meta::ownerreference_from_resource, pod::{ @@ -87,6 +67,27 @@ use crate::{ }, }; +use super::{ + node_config::{CONFIGURATION_FILE_OPENSEARCH_YML, NodeConfig}, + product_logging::config::{ + CONFIGURATION_FILE_LOG4J2_PROPERTIES, create_log4j2_config, vector_config_file_content, + }, +}; +use crate::{ + controller::{ + ContextNames, HTTP_PORT, HTTP_PORT_NAME, OpenSearchRoleGroupConfig, TRANSPORT_PORT, + TRANSPORT_PORT_NAME, ValidatedCluster, ValidatedNodeRole, ValidatedSecurity, + build::{ + product_logging::config::{ + MAX_OPENSEARCH_SERVER_LOG_FILES_SIZE, vector_config_file_extra_env_vars, + }, + role_builder::security_config_map_name, + }, + replicas, + }, + crd::{ExtendedSecuritySettingsFileType, v1alpha1}, +}; + constant!(CONFIG_VOLUME_NAME: VolumeName = "config"); constant!(LOG_CONFIG_VOLUME_NAME: VolumeName = "log-config"); @@ -365,7 +366,7 @@ impl<'a> RoleGroupBuilder<'a> { let spec = StatefulSetSpec { // Order does not matter for OpenSearch pod_management_policy: Some("Parallel".to_string()), - replicas: Some(self.role_group_config.replicas.into()), + replicas: Some(replicas(&self.role_group_config).into()), selector: LabelSelector { match_labels: Some(self.pod_selector().into()), ..LabelSelector::default() @@ -578,7 +579,7 @@ impl<'a> RoleGroupBuilder<'a> { ) .with_field_path( &EnvVarName::from_str_unsafe("POD_NAME"), - FieldPathEnvVar::Name, + &FieldPathEnvVar::Name, ); let volume_mounts = vec![ @@ -925,7 +926,7 @@ impl<'a> RoleGroupBuilder<'a> { ) .with_field_path( &EnvVarName::from_str_unsafe("POD_NAME"), - FieldPathEnvVar::Name, + &FieldPathEnvVar::Name, ); for file_type in settings { @@ -1453,6 +1454,21 @@ mod tests { kvp::LabelValue, product_logging::spec::AutomaticContainerLogConfig, shared::time::Duration, + v2::{ + builder::pod::container::EnvVarSet, + product_logging::framework::VectorContainerLogConfig, + role_utils::GenericCommonConfig, + types::{ + kubernetes::{ + ConfigMapKey, ConfigMapName, ListenerClassName, ListenerName, NamespaceName, + SecretClassName, SecretKey, SecretName, ServiceAccountName, ServiceName, + }, + operator::{ + ClusterName, ControllerName, OperatorName, ProductName, ProductVersion, + RoleGroupName, + }, + }, + }, }; use strum::IntoEnumIterator; use uuid::uuid; @@ -1472,21 +1488,6 @@ mod tests { }, }, crd::{OpenSearchKeystoreKey, v1alpha1}, - framework::{ - builder::pod::container::EnvVarSet, - product_logging::framework::VectorContainerLogConfig, - role_utils::GenericCommonConfig, - types::{ - kubernetes::{ - ConfigMapKey, ConfigMapName, ListenerClassName, ListenerName, NamespaceName, - SecretClassName, SecretKey, SecretName, ServiceAccountName, ServiceName, - }, - operator::{ - ClusterName, ControllerName, OperatorName, ProductName, ProductVersion, - RoleGroupName, - }, - }, - }, }; #[test] @@ -1553,7 +1554,7 @@ mod tests { }; let role_group_config = OpenSearchRoleGroupConfig { - replicas: 1, + replicas: Some(1), config: ValidatedOpenSearchConfig { affinity: StackableAffinity::default(), discovery_service_exposed: true, diff --git a/rust/operator-binary/src/controller/dereference.rs b/rust/operator-binary/src/controller/dereference.rs index 24adf745..f0a8affc 100644 --- a/rust/operator-binary/src/controller/dereference.rs +++ b/rust/operator-binary/src/controller/dereference.rs @@ -1,16 +1,19 @@ //! The dereference step in the OpenSearchCluster controller use snafu::{ResultExt, Snafu}; -use stackable_operator::{client::Client, crd::listener}; +use stackable_operator::{ + client::Client, + crd::listener, + v2::{ + controller_utils::{get_cluster_name, get_namespace}, + types::{kubernetes::NamespaceName, operator::ClusterName}, + }, +}; use strum::{EnumDiscriminants, IntoStaticStr}; use crate::{ controller::{DereferencedObjects, build::role_builder}, crd::v1alpha1, - framework::{ - controller_utils::{get_cluster_name, get_namespace}, - types::{kubernetes::NamespaceName, operator::ClusterName}, - }, }; #[derive(Snafu, Debug, EnumDiscriminants)] @@ -18,12 +21,12 @@ use crate::{ pub enum Error { #[snafu(display("failed to get the cluster name"))] GetClusterName { - source: crate::framework::controller_utils::Error, + source: stackable_operator::v2::controller_utils::Error, }, #[snafu(display("failed to get the cluster namespace"))] GetClusterNamespace { - source: crate::framework::controller_utils::Error, + source: stackable_operator::v2::controller_utils::Error, }, #[snafu(display("failed to fetch the discovery service listener"))] diff --git a/rust/operator-binary/src/controller/validate.rs b/rust/operator-binary/src/controller/validate.rs index d14a3f5c..9ee7b7c8 100644 --- a/rust/operator-binary/src/controller/validate.rs +++ b/rust/operator-binary/src/controller/validate.rs @@ -4,8 +4,25 @@ use std::{collections::BTreeMap, str::FromStr}; use snafu::{OptionExt, ResultExt, Snafu, ensure}; use stackable_operator::{ - cli::OperatorEnvironmentOptions, crd::listener, kube::ResourceExt, - product_logging::spec::Logging, role_utils::RoleGroup, shared::time::Duration, + cli::OperatorEnvironmentOptions, + crd::listener, + kube::ResourceExt, + product_logging::spec::Logging, + role_utils::RoleGroup, + shared::time::Duration, + v2::{ + builder::pod::container::{EnvVarName, EnvVarSet}, + controller_utils::{get_cluster_name, get_namespace, get_uid}, + product_logging::framework::{ + VectorContainerLogConfig, validate_logging_configuration_for_container, + }, + role_utils::{RoleGroupConfig, with_validated_config}, + types::{ + common::Port, + kubernetes::{ConfigMapName, Hostname}, + operator::ClusterName, + }, + }, }; use strum::{EnumDiscriminants, IntoStaticStr}; @@ -19,19 +36,6 @@ use crate::{ ValidatedNodeRoles, ValidatedOpenSearchConfigOverrides, ValidatedSecurity, }, crd::{NodeRoles, OpenSearchRoleGroup, v1alpha1}, - framework::{ - builder::pod::container::{EnvVarName, EnvVarSet}, - controller_utils::{get_cluster_name, get_namespace, get_uid}, - product_logging::framework::{ - VectorContainerLogConfig, validate_logging_configuration_for_container, - }, - role_utils::{RoleGroupConfig, with_validated_config}, - types::{ - common::Port, - kubernetes::{ConfigMapName, Hostname}, - operator::ClusterName, - }, - }, }; #[derive(Snafu, Debug, EnumDiscriminants)] @@ -54,17 +58,17 @@ pub enum Error { #[snafu(display("failed to get the cluster name"))] GetClusterName { - source: crate::framework::controller_utils::Error, + source: stackable_operator::v2::controller_utils::Error, }, #[snafu(display("failed to get the cluster namespace"))] GetClusterNamespace { - source: crate::framework::controller_utils::Error, + source: stackable_operator::v2::controller_utils::Error, }, #[snafu(display("failed to get the cluster UID"))] GetClusterUid { - source: crate::framework::controller_utils::Error, + source: stackable_operator::v2::controller_utils::Error, }, #[snafu(display("failed to get the port of the Listener status"))] @@ -77,27 +81,27 @@ pub enum Error { #[snafu(display("failed to parse environment variable"))] ParseEnvironmentVariable { - source: crate::framework::builder::pod::container::Error, + source: stackable_operator::v2::builder::pod::container::Error, }, #[snafu(display("failed to parse the hostname of the Listener status"))] ParseListenerStatusHostname { - source: crate::framework::macros::attributed_string_type::Error, + source: stackable_operator::v2::macros::attributed_string_type::Error, }, #[snafu(display("failed to parse the port of the Listener status"))] ParseListenerStatusPort { - source: crate::framework::types::common::Error, + source: stackable_operator::v2::types::common::Error, }, #[snafu(display("failed to set product version"))] ParseProductVersion { - source: crate::framework::macros::attributed_string_type::Error, + source: stackable_operator::v2::macros::attributed_string_type::Error, }, #[snafu(display("failed to set role-group name"))] ParseRoleGroupName { - source: crate::framework::macros::attributed_string_type::Error, + source: stackable_operator::v2::macros::attributed_string_type::Error, }, #[snafu(display("failed to resolve product image"))] @@ -113,7 +117,7 @@ pub enum Error { #[snafu(display("failed to validate the logging configuration"))] ValidateLoggingConfig { - source: crate::framework::product_logging::framework::Error, + source: stackable_operator::v2::product_logging::framework::Error, }, #[snafu(display("fragment validation failure"))] @@ -254,8 +258,7 @@ fn validate_role_group_config( } Ok(RoleGroupConfig { - // Kubernetes defaults to 1 if not set - replicas: merged_role_group.replicas.unwrap_or(1), + replicas: merged_role_group.replicas, config: validated_config, config_overrides: validated_config_overrides, env_overrides, @@ -270,7 +273,7 @@ fn validate_logging_configuration( vector_aggregator_config_map_name: &Option, ) -> Result { let opensearch_container = - validate_logging_configuration_for_container(logging, v1alpha1::Container::OpenSearch) + validate_logging_configuration_for_container(logging, &v1alpha1::Container::OpenSearch) .context(ValidateLoggingConfigSnafu)?; let vector_container = if logging.enable_vector_agent { @@ -280,7 +283,7 @@ fn validate_logging_configuration( Some(VectorContainerLogConfig { log_config: validate_logging_configuration_for_container( logging, - v1alpha1::Container::Vector, + &v1alpha1::Container::Vector, ) .context(ValidateLoggingConfigSnafu)?, vector_aggregator_config_map_name, @@ -463,19 +466,7 @@ mod tests { }, role_utils::{CommonConfiguration, Role, RoleGroup}, shared::time::Duration, - }; - use uuid::uuid; - - use super::{ErrorDiscriminants, validate}; - use crate::{ - built_info, - controller::{ - ContextNames, DereferencedObjects, ValidatedCluster, ValidatedDiscoveryEndpoint, - ValidatedLogging, ValidatedNodeRole, ValidatedOpenSearchConfig, - ValidatedOpenSearchConfigOverrides, ValidatedSecurity, - }, - crd::{NodeRoles, OpenSearchKeystoreKey, v1alpha1}, - framework::{ + v2::{ builder::pod::container::{EnvVarName, EnvVarSet}, config_overrides::{JsonConfigOverrides, JsonOrKeyValueConfigOverrides}, product_logging::framework::{ @@ -495,6 +486,18 @@ mod tests { }, }, }; + use uuid::uuid; + + use super::{ErrorDiscriminants, validate}; + use crate::{ + built_info, + controller::{ + ContextNames, DereferencedObjects, ValidatedCluster, ValidatedDiscoveryEndpoint, + ValidatedLogging, ValidatedNodeRole, ValidatedOpenSearchConfig, + ValidatedOpenSearchConfigOverrides, ValidatedSecurity, + }, + crd::{NodeRoles, OpenSearchKeystoreKey, v1alpha1}, + }; #[test] fn test_validate_ok() { @@ -529,7 +532,7 @@ mod tests { [( RoleGroupName::from_str_unsafe("default"), RoleGroupConfig { - replicas: 3, + replicas: Some(3), config: ValidatedOpenSearchConfig { affinity: StackableAffinity { pod_anti_affinity: Some(PodAntiAffinity { diff --git a/rust/operator-binary/src/crd/mod.rs b/rust/operator-binary/src/crd/mod.rs index 88de2013..c30faea1 100644 --- a/rust/operator-binary/src/crd/mod.rs +++ b/rust/operator-binary/src/crd/mod.rs @@ -3,6 +3,7 @@ use std::{array, str::FromStr}; use serde::{Deserialize, Serialize}; use serde_json::json; use stackable_operator::{ + attributed_string_type, commons::{ affinity::{StackableAffinity, StackableAffinityFragment, affinity_between_role_pods}, cluster_operation::ClusterOperation, @@ -16,6 +17,7 @@ use stackable_operator::{ fragment::Fragment, merge::{Atomic, Merge}, }, + constant, deep_merger::ObjectOverrides, k8s_openapi::{api::core::v1::PodAntiAffinity, apimachinery::pkg::api::resource::Quantity}, kube::CustomResource, @@ -25,13 +27,7 @@ use stackable_operator::{ shared::time::Duration, status::condition::{ClusterCondition, HasStatusCondition}, utils::crds::raw_object_schema, - versioned::versioned, -}; -use strum::{Display, EnumIter}; - -use crate::{ - attributed_string_type, constant, - framework::{ + v2::{ NameIsValidLabelValue, config_overrides::JsonOrKeyValueConfigOverrides, role_utils::GenericCommonConfig, @@ -43,7 +39,9 @@ use crate::{ operator::{ClusterName, ProductName, RoleGroupName, RoleName}, }, }, + versioned::versioned, }; +use strum::{Display, EnumIter}; constant!(DEFAULT_ROLE_GROUP_LISTENER_CLASS: ListenerClassName = "cluster-internal"); constant!(DEFAULT_DISCOVERY_SERVICE_LISTENER_CLASS: ListenerClassName = "cluster-internal"); @@ -877,7 +875,14 @@ mod tests { use stackable_operator::versioned::test_utils::RoundtripTestData; use strum::IntoEnumIterator; - use crate::crd::{security_config_managing_role_group_default, v1alpha1}; + use crate::crd::{ + OpenSearchKeystoreKey, security_config_managing_role_group_default, v1alpha1, + }; + + #[test] + fn test_attributed_string_type_examples() { + OpenSearchKeystoreKey::test_example(); + } #[test] fn test_node_role() { diff --git a/rust/operator-binary/src/framework.rs b/rust/operator-binary/src/framework.rs deleted file mode 100644 index 08967a78..00000000 --- a/rust/operator-binary/src/framework.rs +++ /dev/null @@ -1,53 +0,0 @@ -//! Additions to stackable-operator -//! -//! Functions in stackable-operator usually accept generic types like strings and validate the -//! parameters as late as possible. Therefore, nearly all functions have to return a [`Result`] and -//! errors are returned along the call chain. That makes error handling complex because every -//! module re-packages the received error. Also, the validation is repeated if the value is used in -//! different function calls. Sometimes, validation is not necessary if constant values are used, -//! e.g. the name of the operator. -//! -//! The OpenSearch operator uses a different approach. The incoming values are validated as early -//! as possible and wrapped in a fail-safe type. This type is then used along the call chain, -//! validation is not necessary anymore and functions without side effects do not need to return a -//! [`Result`]. -//! -//! However, the OpenSearch operator uses stackable-operator and at the interface, the fail-safe -//! types must be unwrapped and the [`Result`] returned by the stackable-operator function must be -//! handled. This is done by calling [`Result::expect`] which requires thorough testing. -//! -//! When the development of the OpenSearch operator has progressed and changes in this module -//! become less frequent, then this module can be incorporated into stackable-operator. The module -//! structure should already resemble the one of stackable-operator. - -use types::kubernetes::Uid; - -pub mod builder; -pub mod cluster_resources; -pub mod config_overrides; -pub mod controller_utils; -pub mod kvp; -pub mod macros; -pub mod product_logging; -pub mod role_group_utils; -pub mod role_utils; -pub mod types; - -/// Has a non-empty name -/// -/// Useful as an object reference; Should not be used to create an object because the name could -/// violate the naming constraints (e.g. maximum length) of the object. -pub trait HasName { - #[allow(dead_code)] - fn to_name(&self) -> String; -} - -/// Has a Kubernetes UID -pub trait HasUid { - fn to_uid(&self) -> Uid; -} - -/// The name is a valid label value -pub trait NameIsValidLabelValue { - fn to_label_value(&self) -> String; -} diff --git a/rust/operator-binary/src/framework/builder.rs b/rust/operator-binary/src/framework/builder.rs deleted file mode 100644 index e1f5525b..00000000 --- a/rust/operator-binary/src/framework/builder.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub mod meta; -pub mod pdb; -pub mod pod; -pub mod statefulset; diff --git a/rust/operator-binary/src/framework/builder/meta.rs b/rust/operator-binary/src/framework/builder/meta.rs deleted file mode 100644 index 5034004f..00000000 --- a/rust/operator-binary/src/framework/builder/meta.rs +++ /dev/null @@ -1,124 +0,0 @@ -use stackable_operator::{ - builder::meta::OwnerReferenceBuilder, - k8s_openapi::apimachinery::pkg::apis::meta::v1::OwnerReference, kube::Resource, -}; - -use crate::framework::{HasName, HasUid}; - -/// Infallible variant of -/// [`stackable_operator::builder::meta::ObjectMetaBuilder::ownerreference_from_resource`] -pub fn ownerreference_from_resource( - resource: &(impl Resource + HasName + HasUid), - block_owner_deletion: Option, - controller: Option, -) -> OwnerReference { - OwnerReferenceBuilder::new() - // Set api_version, kind, name and additionally the UID if it exists. - .initialize_from_resource(resource) - // Ensure that the name is set. - .name(resource.to_name()) - // Ensure that the UID is set. - .uid(resource.to_uid().to_string()) - .block_owner_deletion_opt(block_owner_deletion) - .controller_opt(controller) - .build() - .expect( - "OwnerReference should be created because the resource has an api_version, kind, name \ - and uid.", - ) -} - -#[cfg(test)] -mod tests { - use std::borrow::Cow; - - use stackable_operator::{ - k8s_openapi::apimachinery::pkg::apis::meta::v1::{ObjectMeta, OwnerReference}, - kube::Resource, - }; - - use crate::framework::{HasName, HasUid, Uid, builder::meta::ownerreference_from_resource}; - - struct Cluster { - object_meta: ObjectMeta, - } - - impl Cluster { - fn new() -> Self { - Cluster { - object_meta: ObjectMeta { - name: Some("cluster-name".to_owned()), - uid: Some("a6b89911-d48e-4328-88d6-b9251226583d".to_owned()), - ..ObjectMeta::default() - }, - } - } - } - - impl Resource for Cluster { - type DynamicType = (); - type Scope = (); - - fn kind(_dt: &Self::DynamicType) -> Cow<'_, str> { - Cow::from("kind") - } - - fn group(_dt: &Self::DynamicType) -> Cow<'_, str> { - Cow::from("group") - } - - fn version(_dt: &Self::DynamicType) -> Cow<'_, str> { - Cow::from("version") - } - - fn plural(_dt: &Self::DynamicType) -> Cow<'_, str> { - Cow::from("plural") - } - - fn meta(&self) -> &ObjectMeta { - &self.object_meta - } - - fn meta_mut(&mut self) -> &mut ObjectMeta { - &mut self.object_meta - } - } - - impl HasName for Cluster { - fn to_name(&self) -> String { - self.object_meta - .name - .clone() - .expect("should be set in Cluster::new") - } - } - - impl HasUid for Cluster { - fn to_uid(&self) -> Uid { - Uid::from_str_unsafe( - &self - .object_meta - .uid - .clone() - .expect("should be set in Cluster::new"), - ) - } - } - - #[test] - fn test_ownerreference_from_resource() { - let actual_owner_reference = - ownerreference_from_resource(&Cluster::new(), Some(true), Some(true)); - - let expected_owner_reference = OwnerReference { - api_version: "group/version".to_owned(), - block_owner_deletion: Some(true), - controller: Some(true), - kind: "kind".to_owned(), - name: "cluster-name".to_owned(), - uid: "a6b89911-d48e-4328-88d6-b9251226583d".to_owned(), - }; - - assert_eq!(expected_owner_reference, actual_owner_reference); - } -} diff --git a/rust/operator-binary/src/framework/builder/pdb.rs b/rust/operator-binary/src/framework/builder/pdb.rs deleted file mode 100644 index b9c7fdc9..00000000 --- a/rust/operator-binary/src/framework/builder/pdb.rs +++ /dev/null @@ -1,189 +0,0 @@ -use stackable_operator::{ - builder::pdb::PodDisruptionBudgetBuilder, - k8s_openapi::apimachinery::pkg::apis::meta::v1::LabelSelector, - kube::{Resource, api::ObjectMeta}, -}; - -use crate::framework::{ - HasName, HasUid, NameIsValidLabelValue, - types::operator::{ControllerName, OperatorName, ProductName, RoleName}, -}; - -/// Infallible variant of -/// [`stackable_operator::builder::pdb::PodDisruptionBudgetBuilder::new_with_role`] -pub fn pod_disruption_budget_builder_with_role( - owner: &(impl Resource + HasName + NameIsValidLabelValue + HasUid), - product_name: &ProductName, - role_name: &RoleName, - operator_name: &OperatorName, - controller_name: &ControllerName, -) -> PodDisruptionBudgetBuilder { - PodDisruptionBudgetBuilder::new_with_role( - owner, - &product_name.to_label_value(), - &role_name.to_label_value(), - &operator_name.to_label_value(), - &controller_name.to_label_value(), - ) - .expect( - "PodDisruptionBudgetBuilder should be created because the owner has an object name and UID \ - and all given parameters produce valid label values.", - ) -} - -#[cfg(test)] -mod tests { - use std::borrow::Cow; - - use stackable_operator::{ - k8s_openapi::{ - api::policy::v1::{PodDisruptionBudget, PodDisruptionBudgetSpec}, - apimachinery::pkg::{ - apis::meta::v1::{LabelSelector, ObjectMeta, OwnerReference}, - util::intstr::IntOrString, - }, - }, - kube::Resource, - }; - - use crate::framework::{ - HasName, HasUid, NameIsValidLabelValue, - builder::pdb::pod_disruption_budget_builder_with_role, - types::{ - kubernetes::Uid, - operator::{ControllerName, OperatorName, ProductName, RoleName}, - }, - }; - - struct Cluster { - object_meta: ObjectMeta, - } - - impl Cluster { - fn new() -> Self { - Cluster { - object_meta: ObjectMeta { - name: Some("cluster-name".to_owned()), - uid: Some("a6b89911-d48e-4328-88d6-b9251226583d".to_owned()), - ..ObjectMeta::default() - }, - } - } - } - - impl Resource for Cluster { - type DynamicType = (); - type Scope = (); - - fn kind(_dt: &Self::DynamicType) -> Cow<'_, str> { - Cow::from("kind") - } - - fn group(_dt: &Self::DynamicType) -> Cow<'_, str> { - Cow::from("group") - } - - fn version(_dt: &Self::DynamicType) -> Cow<'_, str> { - Cow::from("version") - } - - fn plural(_dt: &Self::DynamicType) -> Cow<'_, str> { - Cow::from("plural") - } - - fn meta(&self) -> &ObjectMeta { - &self.object_meta - } - - fn meta_mut(&mut self) -> &mut ObjectMeta { - &mut self.object_meta - } - } - - impl HasName for Cluster { - fn to_name(&self) -> String { - self.object_meta - .name - .clone() - .expect("should be set in Cluster::new") - } - } - - impl HasUid for Cluster { - fn to_uid(&self) -> Uid { - Uid::from_str_unsafe( - &self - .object_meta - .uid - .clone() - .expect("should be set in Cluster::new"), - ) - } - } - - impl NameIsValidLabelValue for Cluster { - fn to_label_value(&self) -> String { - self.object_meta - .name - .clone() - .expect("should be set in Cluster::new") - } - } - - #[test] - fn test_pod_disruption_budget_builder_with_role() { - let actual_pdb = pod_disruption_budget_builder_with_role( - &Cluster::new(), - &ProductName::from_str_unsafe("my-product"), - &RoleName::from_str_unsafe("my-role"), - &OperatorName::from_str_unsafe("my-operator"), - &ControllerName::from_str_unsafe("my-controller"), - ) - .with_max_unavailable(2) - .build(); - - let expected_pdb = PodDisruptionBudget { - metadata: ObjectMeta { - labels: Some( - [ - ("app.kubernetes.io/component", "my-role"), - ("app.kubernetes.io/instance", "cluster-name"), - ("app.kubernetes.io/managed-by", "my-operator_my-controller"), - ("app.kubernetes.io/name", "my-product"), - ] - .map(|(k, v)| (k.to_owned(), v.to_owned())) - .into(), - ), - name: Some("cluster-name-my-role".to_owned()), - owner_references: Some(vec![OwnerReference { - api_version: "group/version".to_owned(), - controller: Some(true), - kind: "kind".to_owned(), - name: "cluster-name".to_owned(), - uid: "a6b89911-d48e-4328-88d6-b9251226583d".to_owned(), - ..OwnerReference::default() - }]), - ..ObjectMeta::default() - }, - spec: Some(PodDisruptionBudgetSpec { - max_unavailable: Some(IntOrString::Int(2)), - selector: Some(LabelSelector { - match_labels: Some( - [ - ("app.kubernetes.io/component", "my-role"), - ("app.kubernetes.io/instance", "cluster-name"), - ("app.kubernetes.io/name", "my-product"), - ] - .map(|(k, v)| (k.to_owned(), v.to_owned())) - .into(), - ), - ..LabelSelector::default() - }), - ..PodDisruptionBudgetSpec::default() - }), - ..PodDisruptionBudget::default() - }; - - assert_eq!(expected_pdb, actual_pdb); - } -} diff --git a/rust/operator-binary/src/framework/builder/pod.rs b/rust/operator-binary/src/framework/builder/pod.rs deleted file mode 100644 index df93bd44..00000000 --- a/rust/operator-binary/src/framework/builder/pod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod container; -pub mod volume; diff --git a/rust/operator-binary/src/framework/builder/pod/container.rs b/rust/operator-binary/src/framework/builder/pod/container.rs deleted file mode 100644 index f5cb34bc..00000000 --- a/rust/operator-binary/src/framework/builder/pod/container.rs +++ /dev/null @@ -1,380 +0,0 @@ -use std::{ - collections::{BTreeMap, btree_map}, - fmt::Display, - str::FromStr, -}; - -use snafu::Snafu; -use stackable_operator::{ - builder::pod::container::{ContainerBuilder, FieldPathEnvVar}, - k8s_openapi::api::core::v1::{ConfigMapKeySelector, EnvVar, EnvVarSource, ObjectFieldSelector}, -}; -use strum::{EnumDiscriminants, IntoStaticStr}; - -use crate::framework::types::kubernetes::{ConfigMapKey, ConfigMapName, ContainerName}; - -#[derive(Snafu, Debug, EnumDiscriminants)] -#[strum_discriminants(derive(IntoStaticStr))] -pub enum Error { - #[snafu(display( - "invalid environment variable name: a valid environment variable name must not be empty \ - and must consist only of printable ASCII characters other than '='" - ))] - ParseEnvVarName { env_var_name: String }, -} - -/// Infallible variant of [`stackable_operator::builder::pod::container::ContainerBuilder::new`] -pub fn new_container_builder(container_name: &ContainerName) -> ContainerBuilder { - ContainerBuilder::new(container_name.as_ref()).expect("should be a valid container name") -} - -// TODO Use attributed_string_type instead -/// Validated environment variable name -#[derive(Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] -pub struct EnvVarName(String); - -impl EnvVarName { - /// Creates an [`EnvVarName`] from the given string and panics if the validation failed - /// - /// Use this only with constant names that are also tested in unit tests! - pub fn from_str_unsafe(s: &str) -> Self { - EnvVarName::from_str(s).expect("should be a valid environment variable name") - } -} - -impl Display for EnvVarName { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - self.0.fmt(f) - } -} - -impl FromStr for EnvVarName { - type Err = Error; - - fn from_str(s: &str) -> Result { - // The length of environment variable names seems not to be restricted. - - if !s.is_empty() && s.chars().all(|c| matches!(c, ' '..='<' | '>'..='~')) { - Ok(Self(s.to_owned())) - } else { - Err(Error::ParseEnvVarName { - env_var_name: s.to_owned(), - }) - } - } -} - -/// A set of [`EnvVar`]s -/// -/// The environment variable names in the set are unique. -#[derive(Clone, Debug, Default, PartialEq)] -pub struct EnvVarSet(BTreeMap); - -impl EnvVarSet { - /// Creates an empty [`EnvVarSet`] - pub fn new() -> Self { - Self::default() - } - - /// Returns a reference to the [`EnvVar`] with the given name - pub fn get(&self, env_var_name: &EnvVarName) -> Option<&EnvVar> { - self.0.get(env_var_name) - } - - /// Moves all [`EnvVar`]s from the given set into this one. - /// - /// [`EnvVar`]s with the same name are overridden. - pub fn merge(mut self, mut env_var_set: EnvVarSet) -> Self { - self.0.append(&mut env_var_set.0); - - self - } - - /// Adds the given [`EnvVar`]s to this set - /// - /// [`EnvVar`]s with the same name are overridden. - pub fn with_values(self, env_vars: I) -> Self - where - I: IntoIterator, - V: Into, - { - env_vars - .into_iter() - .fold(self, |extended_env_vars, (name, value)| { - extended_env_vars.with_value(&name, value) - }) - } - - /// Adds an environment variable with the given name and string value to this set - /// - /// An [`EnvVar`] with the same name is overridden. - pub fn with_value(mut self, name: &EnvVarName, value: impl Into) -> Self { - self.0.insert( - name.clone(), - EnvVar { - name: name.to_string(), - value: Some(value.into()), - value_from: None, - }, - ); - - self - } - - /// Adds an environment variable with the given name and field path to this set - /// - /// An [`EnvVar`] with the same name is overridden. - pub fn with_field_path(mut self, name: &EnvVarName, field_path: FieldPathEnvVar) -> Self { - self.0.insert( - name.clone(), - EnvVar { - name: name.to_string(), - value: None, - value_from: Some(EnvVarSource { - field_ref: Some(ObjectFieldSelector { - field_path: field_path.to_string(), - ..ObjectFieldSelector::default() - }), - ..EnvVarSource::default() - }), - }, - ); - - self - } - - /// Adds an environment variable with the given ConfigMap key reference to this set - /// - /// An [`EnvVar`] with the same name is overridden. - pub fn with_config_map_key_ref( - mut self, - name: &EnvVarName, - config_map_name: &ConfigMapName, - config_map_key: &ConfigMapKey, - ) -> Self { - self.0.insert( - name.clone(), - EnvVar { - name: name.to_string(), - value: None, - value_from: Some(EnvVarSource { - config_map_key_ref: Some(ConfigMapKeySelector { - key: config_map_key.to_string(), - name: config_map_name.to_string(), - ..ConfigMapKeySelector::default() - }), - ..EnvVarSource::default() - }), - }, - ); - - self - } -} - -impl From for Vec { - fn from(value: EnvVarSet) -> Self { - value.0.values().cloned().collect() - } -} - -impl IntoIterator for EnvVarSet { - type IntoIter = btree_map::IntoValues; - type Item = EnvVar; - - fn into_iter(self) -> Self::IntoIter { - self.0.into_values() - } -} - -#[cfg(test)] -mod tests { - use std::str::FromStr; - - use stackable_operator::{ - builder::pod::container::FieldPathEnvVar, - k8s_openapi::api::core::v1::{ - ConfigMapKeySelector, EnvVar, EnvVarSource, ObjectFieldSelector, - }, - }; - - use super::{EnvVarName, EnvVarSet}; - use crate::framework::{ - builder::pod::container::new_container_builder, - types::kubernetes::{ConfigMapKey, ConfigMapName, ContainerName}, - }; - - #[test] - fn test_envvarname_fromstr() { - // actually accepted by Kubernetes - assert!(EnvVarName::from_str(" !\"#$%&'()*+,-./0123456789:;<>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~").is_ok()); - - // empty string - assert!(EnvVarName::from_str("").is_err()); - // non-printable ASCII characters - assert!(EnvVarName::from_str("\n").is_err()); - assert!(EnvVarName::from_str("€").is_err()); - // equals sign - assert!(EnvVarName::from_str("=").is_err()); - } - - #[test] - fn test_new_container_builder() { - // Test that the function does not panic - new_container_builder(&ContainerName::from_str_unsafe("valid-container-name")); - } - - #[test] - fn test_envvarname_format() { - assert_eq!( - "TEST".to_owned(), - format!("{}", EnvVarName::from_str_unsafe("TEST")) - ); - } - - #[test] - fn test_envvarset_merge() { - let env_var_set1 = EnvVarSet::new().with_values([ - ( - EnvVarName::from_str_unsafe("ENV1"), - "value1 from env_var_set1", - ), - ( - EnvVarName::from_str_unsafe("ENV2"), - "value2 from env_var_set1", - ), - ( - EnvVarName::from_str_unsafe("ENV3"), - "value3 from env_var_set1", - ), - ]); - let env_var_set2 = EnvVarSet::new() - .with_value( - &EnvVarName::from_str_unsafe("ENV2"), - "value2 from env_var_set2", - ) - .with_field_path(&EnvVarName::from_str_unsafe("ENV3"), FieldPathEnvVar::Name) - .with_value( - &EnvVarName::from_str_unsafe("ENV4"), - "value4 from env_var_set2", - ); - - let merged_env_var_set = env_var_set1.merge(env_var_set2); - - assert_eq!( - vec![ - EnvVar { - name: "ENV1".to_owned(), - value: Some("value1 from env_var_set1".to_owned()), - value_from: None - }, - EnvVar { - name: "ENV2".to_owned(), - value: Some("value2 from env_var_set2".to_owned()), - value_from: None - }, - EnvVar { - name: "ENV3".to_owned(), - value: None, - value_from: Some(EnvVarSource { - field_ref: Some(ObjectFieldSelector { - field_path: "metadata.name".to_owned(), - ..ObjectFieldSelector::default() - }), - ..EnvVarSource::default() - }), - }, - EnvVar { - name: "ENV4".to_owned(), - value: Some("value4 from env_var_set2".to_owned()), - value_from: None - } - ], - Vec::from(merged_env_var_set) - ); - } - - #[test] - fn test_envvarset_with_values() { - let env_var_set = EnvVarSet::new().with_values([ - (EnvVarName::from_str_unsafe("ENV1"), "value1"), - (EnvVarName::from_str_unsafe("ENV2"), "value2"), - ]); - - assert_eq!( - vec![ - EnvVar { - name: "ENV1".to_owned(), - value: Some("value1".to_owned()), - value_from: None - }, - EnvVar { - name: "ENV2".to_owned(), - value: Some("value2".to_owned()), - value_from: None - } - ], - Vec::from(env_var_set) - ); - } - - #[test] - fn test_envvarset_with_value() { - let env_var_set = EnvVarSet::new().with_value(&EnvVarName::from_str_unsafe("ENV"), "value"); - - assert_eq!( - Some(&EnvVar { - name: "ENV".to_owned(), - value: Some("value".to_owned()), - value_from: None - }), - env_var_set.get(&EnvVarName::from_str_unsafe("ENV")) - ); - } - - #[test] - fn test_envvarset_with_field_path() { - let env_var_set = EnvVarSet::new() - .with_field_path(&EnvVarName::from_str_unsafe("ENV"), FieldPathEnvVar::Name); - - assert_eq!( - Some(&EnvVar { - name: "ENV".to_owned(), - value: None, - value_from: Some(EnvVarSource { - field_ref: Some(ObjectFieldSelector { - field_path: "metadata.name".to_owned(), - ..ObjectFieldSelector::default() - }), - ..EnvVarSource::default() - }), - }), - env_var_set.get(&EnvVarName::from_str_unsafe("ENV")) - ); - } - - #[test] - fn test_envvarset_with_config_map_key_ref() { - let env_var_set = EnvVarSet::new().with_config_map_key_ref( - &EnvVarName::from_str_unsafe("ENV"), - &ConfigMapName::from_str_unsafe("config-map"), - &ConfigMapKey::from_str_unsafe("key"), - ); - - assert_eq!( - Some(&EnvVar { - name: "ENV".to_owned(), - value: None, - value_from: Some(EnvVarSource { - config_map_key_ref: Some(ConfigMapKeySelector { - key: "key".to_owned(), - name: "config-map".to_owned(), - ..ConfigMapKeySelector::default() - }), - ..EnvVarSource::default() - }), - }), - env_var_set.get(&EnvVarName::from_str_unsafe("ENV")) - ); - } -} diff --git a/rust/operator-binary/src/framework/builder/pod/volume.rs b/rust/operator-binary/src/framework/builder/pod/volume.rs deleted file mode 100644 index 06dc4846..00000000 --- a/rust/operator-binary/src/framework/builder/pod/volume.rs +++ /dev/null @@ -1,48 +0,0 @@ -use stackable_operator::{ - builder::pod::volume::ListenerOperatorVolumeSourceBuilder, - k8s_openapi::api::core::v1::PersistentVolumeClaim, kvp::Labels, -}; - -use crate::framework::types::kubernetes::{ - ListenerClassName, ListenerName, PersistentVolumeClaimName, -}; - -/// Infallible variant of [`stackable_operator::builder::pod::volume::ListenerReference`] -#[derive(Clone, Debug, Eq, PartialEq)] -pub enum ListenerReference { - ListenerClass(ListenerClassName), - Listener(ListenerName), -} - -impl From<&ListenerReference> for stackable_operator::builder::pod::volume::ListenerReference { - fn from(value: &ListenerReference) -> Self { - match value { - ListenerReference::ListenerClass(listener_class_name) => { - stackable_operator::builder::pod::volume::ListenerReference::ListenerClass( - listener_class_name.to_string(), - ) - } - ListenerReference::Listener(listener_name) => { - stackable_operator::builder::pod::volume::ListenerReference::ListenerName( - listener_name.to_string(), - ) - } - } - } -} - -/// Infallible variant of -/// [`stackable_operator::builder::pod::volume::ListenerOperatorVolumeSourceBuilder::build_pvc`] -pub fn listener_operator_volume_source_builder_build_pvc( - listener_reference: &ListenerReference, - labels: &Labels, - pvc_name: &PersistentVolumeClaimName, -) -> PersistentVolumeClaim { - ListenerOperatorVolumeSourceBuilder::new(&listener_reference.into(), labels) - .build_pvc(pvc_name.to_string()) - .expect( - "should return a PersistentVolumeClaim, because the only check is that \ - listener_reference is a valid annotation value and there are no restrictions on single \ - annotation values", - ) -} diff --git a/rust/operator-binary/src/framework/builder/statefulset.rs b/rust/operator-binary/src/framework/builder/statefulset.rs deleted file mode 100644 index 904d333b..00000000 --- a/rust/operator-binary/src/framework/builder/statefulset.rs +++ /dev/null @@ -1,118 +0,0 @@ -use std::collections::BTreeMap; - -use stackable_operator::kvp::Annotations; - -use crate::framework::types::kubernetes::{ConfigMapName, SecretName}; - -/// Creates `restarter.stackable.tech/ignore-configmap.{i}` annotations for each given ConfigMap. -/// -/// The restarter uses these annotations to skip restarting Pods when specific ConfigMaps change. -/// Indices start at 0 and are assigned in iteration order, so **do not merge the result with -/// annotations from another call** — duplicate indices would overwrite each other. -pub fn restarter_ignore_configmap_annotations( - ignored_config_maps: impl IntoIterator, -) -> Annotations { - let annotation_key_values = ignored_config_maps - .into_iter() - .enumerate() - .map(|(i, config_map_name)| { - ( - format!("restarter.stackable.tech/ignore-configmap.{i}"), - config_map_name.to_string(), - ) - }) - .collect::>(); - - Annotations::try_from(annotation_key_values).expect( - "should contain only valid annotations because the annotation keys are statically \ - defined apart from the index number and the names of ConfigMaps are valid annotation \ - values.", - ) -} - -/// Creates `restarter.stackable.tech/ignore-secret.{i}` annotations for each given Secret. -/// -/// The restarter uses these annotations to skip restarting Pods when specific Secrets change. -/// Indices start at 0 and are assigned in iteration order, so **do not merge the result with -/// annotations from another call** — duplicate indices would overwrite each other. -pub fn restarter_ignore_secret_annotations( - ignored_secrets: impl IntoIterator, -) -> Annotations { - let annotation_key_values = ignored_secrets - .into_iter() - .enumerate() - .map(|(i, secret_name)| { - ( - format!("restarter.stackable.tech/ignore-secret.{i}"), - secret_name.to_string(), - ) - }) - .collect::>(); - - Annotations::try_from(annotation_key_values).expect( - "should contain only valid annotations because the annotation keys are statically \ - defined apart from the index number and the names of Secrets are valid annotation \ - values.", - ) -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn multiple_config_maps_produce_indexed_annotations() { - let ignored_config_maps = [ - ConfigMapName::from_str_unsafe("first-config"), - ConfigMapName::from_str_unsafe("second-config"), - ConfigMapName::from_str_unsafe("third-config"), - ]; - - let actual_annotations = restarter_ignore_configmap_annotations(ignored_config_maps); - - let expected_annotations = BTreeMap::from([ - ( - "restarter.stackable.tech/ignore-configmap.0".to_owned(), - "first-config".to_owned(), - ), - ( - "restarter.stackable.tech/ignore-configmap.1".to_owned(), - "second-config".to_owned(), - ), - ( - "restarter.stackable.tech/ignore-configmap.2".to_owned(), - "third-config".to_owned(), - ), - ]); - - assert_eq!(expected_annotations, actual_annotations.into()); - } - - #[test] - fn multiple_secrets_produce_indexed_annotations() { - let ignored_secrets = [ - SecretName::from_str_unsafe("first-secret"), - SecretName::from_str_unsafe("second-secret"), - SecretName::from_str_unsafe("third-secret"), - ]; - - let actual_annotations = restarter_ignore_secret_annotations(ignored_secrets); - - let expected_annotations = BTreeMap::from([ - ( - "restarter.stackable.tech/ignore-secret.0".to_owned(), - "first-secret".to_owned(), - ), - ( - "restarter.stackable.tech/ignore-secret.1".to_owned(), - "second-secret".to_owned(), - ), - ( - "restarter.stackable.tech/ignore-secret.2".to_owned(), - "third-secret".to_owned(), - ), - ]); - - assert_eq!(expected_annotations, actual_annotations.into()); - } -} diff --git a/rust/operator-binary/src/framework/cluster_resources.rs b/rust/operator-binary/src/framework/cluster_resources.rs deleted file mode 100644 index 430b534f..00000000 --- a/rust/operator-binary/src/framework/cluster_resources.rs +++ /dev/null @@ -1,50 +0,0 @@ -use stackable_operator::{ - cluster_resources::{ClusterResourceApplyStrategy, ClusterResources}, - deep_merger::ObjectOverrides, - k8s_openapi::api::core::v1::ObjectReference, -}; - -use super::types::{ - kubernetes::{NamespaceName, Uid}, - operator::{ClusterName, ControllerName, OperatorName, ProductName}, -}; -use crate::framework::{ - NameIsValidLabelValue, macros::attributed_string_type::MAX_LABEL_VALUE_LENGTH, -}; - -/// Infallible variant of [`stackable_operator::cluster_resources::ClusterResources::new`] -#[allow(clippy::too_many_arguments)] -pub fn cluster_resources_new<'a>( - product_name: &ProductName, - operator_name: &OperatorName, - controller_name: &ControllerName, - cluster_name: &ClusterName, - cluster_namespace: &NamespaceName, - cluster_uid: &Uid, - apply_strategy: ClusterResourceApplyStrategy, - object_overrides: &'a ObjectOverrides, -) -> ClusterResources<'a> { - // compile-time check - // ClusterResources::new creates a label value from the given app name by appending - // `-operator`. For the resulting label value to be valid, it must not exceed - // MAX_LABEL_VALUE_LENGTH. - const _: () = assert!( - ProductName::MAX_LENGTH + "-operator".len() <= MAX_LABEL_VALUE_LENGTH, - "The string `-operator` must not exceed the limit of Label names." - ); - - ClusterResources::new( - &product_name.to_label_value(), - &operator_name.to_label_value(), - &controller_name.to_label_value(), - &ObjectReference { - name: Some(cluster_name.to_string()), - namespace: Some(cluster_namespace.to_string()), - uid: Some(cluster_uid.to_string()), - ..Default::default() - }, - apply_strategy, - object_overrides, - ) - .expect("ClusterResources should be created because the cluster object reference contains name, namespace and uid.") -} diff --git a/rust/operator-binary/src/framework/config_overrides.rs b/rust/operator-binary/src/framework/config_overrides.rs deleted file mode 100644 index 4cc31ffd..00000000 --- a/rust/operator-binary/src/framework/config_overrides.rs +++ /dev/null @@ -1,443 +0,0 @@ -use std::collections::BTreeMap; - -use schemars::JsonSchema; -use serde::{Deserialize, Serialize}; -use serde_json::json; -use stackable_operator::{ - config::merge::Merge, k8s_openapi::DeepMerge, schemars, utils::crds::raw_object_schema, -}; -use tracing::warn; - -// Variant of [`stackable_operator::config_overrides::KeyValueConfigOverrides`] that implements -// Merge -/// Flat key-value overrides for `*.properties`, Hadoop XML, etc. -/// -/// This is backwards-compatible with the existing flat key-value YAML format -/// used by `HashMap`. -#[derive(Clone, Debug, Default, Deserialize, Eq, JsonSchema, Merge, PartialEq, Serialize)] -pub struct KeyValueConfigOverrides { - #[serde(flatten)] - pub overrides: BTreeMap>, -} - -// Variant of [`stackable_operator::config_overrides::JsonConfigOverrides`] with the following -// changes: -// - Implements Default -// - Implements Merge by using a Sequence variant which is not exposed in the CRD -// - `JsonPatches` was renamed to `JsonPatch` because it is one patch consisting of multiple -// operations. -// - `JsonPatch` contains a `json_patch::Patch` instead of a vector of strings -/// ConfigOverrides that can be applied to a JSON file. -#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)] -#[serde(rename_all = "camelCase")] -pub enum JsonConfigOverrides { - /// Can be set to arbitrary YAML content, which is converted to JSON and used as - /// [RFC 7396](https://datatracker.ietf.org/doc/html/rfc7396) JSON merge patch. - JsonMergePatch(serde_json::Value), - - /// An [RFC 6902](https://datatracker.ietf.org/doc/html/rfc6902) JSON patch. - /// - /// Can be used when more flexibility is needed, e.g. to only modify elements - /// in a list based on a condition. - /// - /// A patch looks something like - /// - /// `- {"op": "test", "path": "/0/name", "value": "Andrew"}` - /// - /// or - /// - /// `- {"op": "add", "path": "/0/happy", "value": true}` - JsonPatch(json_patch::Patch), - - /// Override the entire config file with the specified JSON value. - UserProvided(serde_json::Value), - - /// Sequence of [`JsonConfigOverrides`] starting with the latest patch - /// - /// This variant is used internally to combine the role and role group configOverrides. They - /// cannot be merged right away because the order of JsonPatch application affects the result. - #[serde(skip)] - Sequence(Vec), -} - -impl JsonConfigOverrides { - // Infallible variant of [`stackable_operator::config_overrides::JsonConfigOverrides::apply`] - pub fn apply(&self, base: &serde_json::Value) -> serde_json::Value { - match self { - Self::JsonMergePatch(patch) => { - let mut doc = base.clone(); - doc.merge_from(patch.clone()); - doc - } - Self::JsonPatch(patch) => { - let mut doc = base.clone(); - if let Err(error) = json_patch::patch(&mut doc, patch) { - warn!("The JSON patch could not be applied: {error}"); - } - doc - } - Self::UserProvided(content) => content.clone(), - Self::Sequence(sequence) => { - let mut doc = base.clone(); - // `sequence` starts with the latest patch. Iterate in reverse order, to apply the - // patches from the first to the last one. - for patch in sequence.iter().rev() { - doc = patch.apply(&doc); - } - doc - } - } - } -} - -impl Default for JsonConfigOverrides { - fn default() -> Self { - // There are several options to represent an empty patch, e.g. - // `JsonConfigOverrides::Sequence(vec![])`. As this is exposed as the default in the CRD, - // an empty JSON merge patch is returned, because JSON merge patches are the preferred way - // to override the configuration. - JsonConfigOverrides::JsonMergePatch(json!({})) - } -} - -impl Merge for JsonConfigOverrides { - fn merge(&mut self, defaults: &Self) { - let mut sequence = if let JsonConfigOverrides::Sequence(sequence) = self { - sequence.clone() - } else { - vec![self.clone()] - }; - - if let JsonConfigOverrides::Sequence(base) = defaults { - sequence.extend(base.clone()); - } else { - sequence.push(defaults.clone()); - } - - *self = JsonConfigOverrides::Sequence(sequence); - } -} - -impl From for JsonConfigOverrides { - fn from(value: KeyValueConfigOverrides) -> Self { - JsonConfigOverrides::JsonMergePatch(value.overrides.into_iter().collect()) - } -} - -/// ConfigOverrides as key-value pairs, JSON merge patch, JSON patch or JSON object. -/// -/// The key-value pairs, JSON merge patch and JSON patch are merged with/applied to the -/// configuration provided by the operator. The user-provided JSON object replaces the -/// configuration of the operator. -/// -/// Example for key-value pairs: -/// -/// stringProperty: new value -/// booleanProperty: "true" -/// -/// Example for a JSON merge patch: -/// -/// jsonMergePatch: -/// stringProperty: new value -/// booleanProperty: true -/// nestedProperty: -/// key: value -/// -/// Example for a JSON patch: -/// -/// jsonPatch: -/// - op: replace -/// path: /stringProperty -/// value: new value -/// -/// Example for a JSON object: -/// -/// userProvided: -/// stringProperty: new value -/// booleanProperty: true -/// nestedProperty: -/// key: value -#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize)] -#[serde(untagged)] -#[schemars(schema_with = "raw_object_schema")] -pub enum JsonOrKeyValueConfigOverrides { - Json(JsonConfigOverrides), - KeyValue(KeyValueConfigOverrides), -} - -impl Default for JsonOrKeyValueConfigOverrides { - fn default() -> Self { - Self::Json(JsonConfigOverrides::default()) - } -} - -impl From for JsonConfigOverrides { - fn from(value: JsonOrKeyValueConfigOverrides) -> Self { - match value { - JsonOrKeyValueConfigOverrides::KeyValue(key_value_config_overrides) => { - key_value_config_overrides.into() - } - JsonOrKeyValueConfigOverrides::Json(json_config_overrides) => json_config_overrides, - } - } -} - -impl Merge for JsonOrKeyValueConfigOverrides { - fn merge(&mut self, defaults: &Self) { - let mut self_json_config_overrides: JsonConfigOverrides = self.clone().into(); - let defaults_json_config_overrides = defaults.clone().into(); - - self_json_config_overrides.merge(&defaults_json_config_overrides); - - *self = Self::Json(self_json_config_overrides); - } -} - -#[cfg(test)] -mod tests { - use serde_json::json; - use stackable_operator::config::merge; - - use super::*; - - #[test] - fn test_json_config_overrides_apply() { - let base = json!({ - "keyA": "base A", - "keyB": "base B" - }); - - let json_merge_patch = JsonConfigOverrides::JsonMergePatch(json!({ - "keyB": "patch B", - "keyC": "patch C" - })); - - assert_eq!( - json!({ - "keyA": "base A", - "keyB": "patch B", - "keyC": "patch C" - }), - json_merge_patch.apply(&base) - ); - - let json_patch = JsonConfigOverrides::JsonPatch( - serde_json::from_value(json!([ - { "op": "replace", "path": "/keyB", "value": "patch B" }, - { "op": "add", "path": "/keyC", "value": "patch C" }, - ])) - .expect("should contain valid JSON patch operations"), - ); - - assert_eq!( - json!({ - "keyA": "base A", - "keyB": "patch B", - "keyC": "patch C", - }), - json_patch.apply(&base) - ); - - let invalid_json_patch = JsonConfigOverrides::JsonPatch( - serde_json::from_value(json!([ - { "op": "replace", "path": "/keyB", "value": "patch B" }, - { "op": "remove", "path": "/keyD" } - ])) - .expect("should contain valid JSON patch operations"), - ); - - // invalid_json_patch cannot be applied because the path "/keyD" does not exist in base. - // A warning should be logged and the changes should be rolled back, i.e. "keyB" should be - // "base B" instead of "patch B". - assert_eq!( - json!({ - "keyA": "base A", - "keyB": "base B", - }), - invalid_json_patch.apply(&base) - ); - - let user_provided = JsonConfigOverrides::UserProvided(json!({ - "keyB": "patch B", - "keyC": "patch C" - })); - - assert_eq!( - json!({ - "keyB": "patch B", - "keyC": "patch C" - }), - user_provided.apply(&base) - ); - - let sequence = JsonConfigOverrides::Sequence(vec![ - // There should be no nested sequences, but as it is not technically prevented, it is - // tested nevertheless. - JsonConfigOverrides::Sequence(vec![JsonConfigOverrides::JsonMergePatch(json!({ - "keyC": "patch C.2", - "keyD": "patch D.2" - }))]), - JsonConfigOverrides::JsonMergePatch(json!({ - "keyB": "patch B.1", - "keyC": "patch C.1" - })), - ]); - - assert_eq!( - json!({ - "keyA": "base A", - "keyB": "patch B.1", - "keyC": "patch C.2", - "keyD": "patch D.2" - }), - sequence.apply(&base) - ); - } - - #[test] - fn test_json_config_overrides_merge() { - let sequence1 = JsonConfigOverrides::Sequence(vec![ - JsonConfigOverrides::JsonMergePatch(json!({ - "key": "sequence 1.2", - })), - JsonConfigOverrides::JsonMergePatch(json!({ - "key": "sequence 1.1", - })), - ]); - - let sequence2 = JsonConfigOverrides::Sequence(vec![ - JsonConfigOverrides::JsonMergePatch(json!({ - "key": "sequence 2.2", - })), - JsonConfigOverrides::JsonMergePatch(json!({ - "key": "sequence 2.1", - })), - ]); - - // It does not matter for the test case if the JsonMergePatch, JsonPatch or UserProvided - // variant is chosen. - let json_merge_patch1 = JsonConfigOverrides::JsonMergePatch(json!({ - "key": "patch 1", - })); - - let json_merge_patch2 = JsonConfigOverrides::JsonMergePatch(json!({ - "key": "patch 2", - })); - - assert_eq!( - JsonConfigOverrides::Sequence(vec![ - JsonConfigOverrides::JsonMergePatch(json!({ - "key": "sequence 2.2", - })), - JsonConfigOverrides::JsonMergePatch(json!({ - "key": "sequence 2.1", - })), - JsonConfigOverrides::JsonMergePatch(json!({ - "key": "sequence 1.2", - })), - JsonConfigOverrides::JsonMergePatch(json!({ - "key": "sequence 1.1", - })), - ]), - merge::merge(sequence2.clone(), &sequence1) - ); - - assert_eq!( - JsonConfigOverrides::Sequence(vec![ - JsonConfigOverrides::JsonMergePatch(json!({ - "key": "patch 2", - })), - JsonConfigOverrides::JsonMergePatch(json!({ - "key": "sequence 1.2", - })), - JsonConfigOverrides::JsonMergePatch(json!({ - "key": "sequence 1.1", - })), - ]), - merge::merge(json_merge_patch2.clone(), &sequence1) - ); - - assert_eq!( - JsonConfigOverrides::Sequence(vec![ - JsonConfigOverrides::JsonMergePatch(json!({ - "key": "sequence 2.2", - })), - JsonConfigOverrides::JsonMergePatch(json!({ - "key": "sequence 2.1", - })), - JsonConfigOverrides::JsonMergePatch(json!({ - "key": "patch 1", - })), - ]), - merge::merge(sequence2.clone(), &json_merge_patch1) - ); - - assert_eq!( - JsonConfigOverrides::Sequence(vec![ - JsonConfigOverrides::JsonMergePatch(json!({ - "key": "patch 2", - })), - JsonConfigOverrides::JsonMergePatch(json!({ - "key": "patch 1", - })), - ]), - merge::merge(json_merge_patch2.clone(), &json_merge_patch1) - ); - } - - #[test] - fn test_json_config_overrides_from_key_value_config_overrides() { - let key_value_config_overrides = KeyValueConfigOverrides { - overrides: [("key".to_owned(), Some("value".to_owned()))].into(), - }; - - let actual_json_config_overrides: JsonConfigOverrides = key_value_config_overrides.into(); - - let expected_json_config_overrides = - JsonConfigOverrides::JsonMergePatch(json!({"key": "value"})); - - assert_eq!(expected_json_config_overrides, actual_json_config_overrides); - } - - #[test] - fn test_json_config_overrides_from_json_or_key_value_config_overrides() { - let key_value_config_overrides = - JsonOrKeyValueConfigOverrides::KeyValue(KeyValueConfigOverrides { - overrides: [("key".to_owned(), Some("value".to_owned()))].into(), - }); - - let actual_json_config_overrides: JsonConfigOverrides = key_value_config_overrides.into(); - - let expected_json_config_overrides = - JsonConfigOverrides::JsonMergePatch(json!({"key": "value"})); - - assert_eq!(expected_json_config_overrides, actual_json_config_overrides); - } - - #[test] - fn test_json_or_key_value_config_overrides_merge() { - let base = JsonOrKeyValueConfigOverrides::KeyValue(KeyValueConfigOverrides { - overrides: [("key".to_owned(), Some("base".to_owned()))].into(), - }); - - let patch = JsonOrKeyValueConfigOverrides::KeyValue(KeyValueConfigOverrides { - overrides: [("key".to_owned(), Some("patch".to_owned()))].into(), - }); - - // The merge implementation internally converts KeyValueConfigOverrides to - // JsonConfigOverrides. It is already tested in [`test_json_config_overrides_merge`] that - // merging JsonConfigOverrides works. Therefore, one test case with KeyValueConfigOverrides - // is sufficient. - assert_eq!( - JsonOrKeyValueConfigOverrides::Json(JsonConfigOverrides::Sequence(vec![ - JsonConfigOverrides::JsonMergePatch(json!({ - "key": "patch", - })), - JsonConfigOverrides::JsonMergePatch(json!({ - "key": "base", - })) - ])), - merge::merge(patch, &base) - ); - } -} diff --git a/rust/operator-binary/src/framework/controller_utils.rs b/rust/operator-binary/src/framework/controller_utils.rs deleted file mode 100644 index d15e53f5..00000000 --- a/rust/operator-binary/src/framework/controller_utils.rs +++ /dev/null @@ -1,211 +0,0 @@ -//! Helper functions which are not tied to a specific controller step - -use std::str::FromStr; - -use snafu::{OptionExt, ResultExt, Snafu}; -use stackable_operator::kube::runtime::reflector::Lookup; -use strum::{EnumDiscriminants, IntoStaticStr}; - -use crate::framework::types::{ - kubernetes::{NamespaceName, Uid}, - operator::ClusterName, -}; - -#[derive(Snafu, Debug, EnumDiscriminants)] -#[strum_discriminants(derive(IntoStaticStr))] -pub enum Error { - #[snafu(display("failed to get the cluster name"))] - GetClusterName {}, - - #[snafu(display("failed to get the namespace"))] - GetNamespace {}, - - #[snafu(display("failed to get the UID"))] - GetUid {}, - - #[snafu(display("failed to set the cluster name"))] - ParseClusterName { - source: crate::framework::macros::attributed_string_type::Error, - }, - - #[snafu(display("failed to set the namespace"))] - ParseNamespace { - source: crate::framework::macros::attributed_string_type::Error, - }, - - #[snafu(display("failed to set the UID"))] - ParseUid { - source: crate::framework::macros::attributed_string_type::Error, - }, -} - -type Result = std::result::Result; - -/// Get the cluster name from the given resource -pub fn get_cluster_name(cluster: &impl Lookup) -> Result { - let raw_cluster_name = cluster.name().context(GetClusterNameSnafu)?; - let cluster_name = ClusterName::from_str(&raw_cluster_name).context(ParseClusterNameSnafu)?; - - Ok(cluster_name) -} - -/// Get the namespace from the given resource -pub fn get_namespace(resource: &impl Lookup) -> Result { - let raw_namespace = resource.namespace().context(GetNamespaceSnafu)?; - let namespace = NamespaceName::from_str(&raw_namespace).context(ParseNamespaceSnafu)?; - - Ok(namespace) -} - -/// Get the UID from the given resource -pub fn get_uid(resource: &impl Lookup) -> Result { - let raw_uid = resource.uid().context(GetUidSnafu)?; - let uid = Uid::from_str(&raw_uid).context(ParseUidSnafu)?; - - Ok(uid) -} - -#[cfg(test)] -mod tests { - use stackable_operator::kube::runtime::reflector::Lookup; - use uuid::uuid; - - use super::{ErrorDiscriminants, get_cluster_name, get_namespace, get_uid}; - use crate::framework::types::{ - kubernetes::{NamespaceName, Uid}, - operator::ClusterName, - }; - - #[derive(Debug, Default)] - struct TestResource { - name: Option<&'static str>, - namespace: Option<&'static str>, - uid: Option<&'static str>, - } - - impl Lookup for TestResource { - type DynamicType = (); - - fn kind(_dyntype: &Self::DynamicType) -> std::borrow::Cow<'_, str> { - "TestResource".into() - } - - fn group(_dyntype: &Self::DynamicType) -> std::borrow::Cow<'_, str> { - "stackable.tech".into() - } - - fn version(_dyntype: &Self::DynamicType) -> std::borrow::Cow<'_, str> { - "v1".into() - } - - fn plural(_dyntype: &Self::DynamicType) -> std::borrow::Cow<'_, str> { - "testresources".into() - } - - fn name(&self) -> Option> { - self.name.map(std::borrow::Cow::Borrowed) - } - - fn namespace(&self) -> Option> { - self.namespace.map(std::borrow::Cow::Borrowed) - } - - fn resource_version(&self) -> Option> { - Some("1".into()) - } - - fn uid(&self) -> Option> { - self.uid.map(std::borrow::Cow::Borrowed) - } - } - - #[test] - fn test_get_cluster_name() { - assert_eq!( - ClusterName::from_str_unsafe("test-cluster"), - get_cluster_name(&TestResource { - name: Some("test-cluster"), - ..TestResource::default() - }) - .expect("should contain a valid cluster name") - ); - - assert_eq!( - Err(ErrorDiscriminants::GetClusterName), - get_cluster_name(&TestResource { - name: None, - ..TestResource::default() - }) - .map_err(ErrorDiscriminants::from) - ); - - assert_eq!( - Err(ErrorDiscriminants::ParseClusterName), - get_cluster_name(&TestResource { - name: Some("invalid cluster name"), - ..TestResource::default() - }) - .map_err(ErrorDiscriminants::from) - ); - } - - #[test] - fn test_get_namespace() { - assert_eq!( - NamespaceName::from_str_unsafe("test-namespace"), - get_namespace(&TestResource { - namespace: Some("test-namespace"), - ..TestResource::default() - }) - .expect("should contain a valid namespace") - ); - - assert_eq!( - Err(ErrorDiscriminants::GetNamespace), - get_namespace(&TestResource { - namespace: None, - ..TestResource::default() - }) - .map_err(ErrorDiscriminants::from) - ); - - assert_eq!( - Err(ErrorDiscriminants::ParseNamespace), - get_namespace(&TestResource { - namespace: Some("invalid namespace"), - ..TestResource::default() - }) - .map_err(ErrorDiscriminants::from) - ); - } - - #[test] - fn test_get_uid() { - assert_eq!( - Uid::from(uuid!("e6ac237d-a6d4-43a1-8135-f36506110912")), - get_uid(&TestResource { - uid: Some("e6ac237d-a6d4-43a1-8135-f36506110912"), - ..TestResource::default() - }) - .expect("should contain a valid UID") - ); - - assert_eq!( - Err(ErrorDiscriminants::GetUid), - get_uid(&TestResource { - uid: None, - ..TestResource::default() - }) - .map_err(ErrorDiscriminants::from) - ); - - assert_eq!( - Err(ErrorDiscriminants::ParseUid), - get_uid(&TestResource { - uid: Some("invalid UID"), - ..TestResource::default() - }) - .map_err(ErrorDiscriminants::from) - ); - } -} diff --git a/rust/operator-binary/src/framework/kvp.rs b/rust/operator-binary/src/framework/kvp.rs deleted file mode 100644 index 0006163a..00000000 --- a/rust/operator-binary/src/framework/kvp.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod label; diff --git a/rust/operator-binary/src/framework/kvp/label.rs b/rust/operator-binary/src/framework/kvp/label.rs deleted file mode 100644 index d20f176c..00000000 --- a/rust/operator-binary/src/framework/kvp/label.rs +++ /dev/null @@ -1,212 +0,0 @@ -use stackable_operator::{ - kube::Resource, - kvp::{Labels, ObjectLabels}, -}; - -use crate::framework::{ - HasName, NameIsValidLabelValue, - types::operator::{ - ControllerName, OperatorName, ProductName, ProductVersion, RoleGroupName, RoleName, - }, -}; - -/// Infallible variant of [`stackable_operator::kvp::Labels::recommended`] -pub fn recommended_labels( - owner: &(impl Resource + HasName + NameIsValidLabelValue), - product_name: &ProductName, - product_version: &ProductVersion, - operator_name: &OperatorName, - controller_name: &ControllerName, - role_name: &RoleName, - role_group_name: &RoleGroupName, -) -> Labels { - let object_labels = ObjectLabels { - owner, - app_name: &product_name.to_label_value(), - app_version: &product_version.to_label_value(), - operator_name: &operator_name.to_label_value(), - controller_name: &controller_name.to_label_value(), - role: &role_name.to_label_value(), - role_group: &role_group_name.to_label_value(), - }; - Labels::recommended(&object_labels).expect( - "Labels should be created because the owner has an object name and all given parameters \ - produce valid label values.", - ) -} - -/// Infallible variant of [`stackable_operator::kvp::Labels::role_selector`] -pub fn role_selector( - owner: &(impl Resource + HasName + NameIsValidLabelValue), - product_name: &ProductName, - role_name: &RoleName, -) -> Labels { - Labels::role_selector( - owner, - &product_name.to_label_value(), - &role_name.to_label_value(), - ) - .expect("Labels should be created because all given parameters produce valid label values") -} - -/// Infallible variant of [`stackable_operator::kvp::Labels::role_group_selector`] -pub fn role_group_selector( - owner: &(impl Resource + HasName + NameIsValidLabelValue), - product_name: &ProductName, - role_name: &RoleName, - role_group_name: &RoleGroupName, -) -> Labels { - Labels::role_group_selector( - owner, - &product_name.to_label_value(), - &role_name.to_label_value(), - &role_group_name.to_label_value(), - ) - .expect("Labels should be created because all given parameters produce valid label values") -} - -#[cfg(test)] -mod tests { - use std::{borrow::Cow, collections::BTreeMap}; - - use stackable_operator::{ - k8s_openapi::apimachinery::pkg::apis::meta::v1::ObjectMeta, kube::Resource, - }; - - use crate::framework::{ - HasName, NameIsValidLabelValue, - kvp::label::{recommended_labels, role_group_selector, role_selector}, - types::operator::{ - ControllerName, OperatorName, ProductName, ProductVersion, RoleGroupName, RoleName, - }, - }; - - struct Cluster { - object_meta: ObjectMeta, - } - - impl Cluster { - fn new() -> Self { - Cluster { - object_meta: ObjectMeta { - name: Some("cluster-name".to_owned()), - ..ObjectMeta::default() - }, - } - } - } - - impl Resource for Cluster { - type DynamicType = (); - type Scope = (); - - fn kind(_dt: &Self::DynamicType) -> Cow<'_, str> { - Cow::from("kind") - } - - fn group(_dt: &Self::DynamicType) -> Cow<'_, str> { - Cow::from("group") - } - - fn version(_dt: &Self::DynamicType) -> Cow<'_, str> { - Cow::from("version") - } - - fn plural(_dt: &Self::DynamicType) -> Cow<'_, str> { - Cow::from("plural") - } - - fn meta(&self) -> &ObjectMeta { - &self.object_meta - } - - fn meta_mut(&mut self) -> &mut ObjectMeta { - &mut self.object_meta - } - } - - impl HasName for Cluster { - fn to_name(&self) -> String { - self.object_meta - .name - .clone() - .expect("should be set in Cluster::new") - } - } - - impl NameIsValidLabelValue for Cluster { - fn to_label_value(&self) -> String { - self.object_meta - .name - .clone() - .expect("should be set in Cluster::new") - } - } - - #[test] - fn test_recommended_labels() { - let actual_labels = recommended_labels( - &Cluster::new(), - &ProductName::from_str_unsafe("my-product"), - &ProductVersion::from_str_unsafe("1.0.0"), - &OperatorName::from_str_unsafe("my-operator"), - &ControllerName::from_str_unsafe("my-controller"), - &RoleName::from_str_unsafe("my-role"), - &RoleGroupName::from_str_unsafe("my-role-group"), - ); - - let expected_labels: BTreeMap = [ - ("app.kubernetes.io/component", "my-role"), - ("app.kubernetes.io/instance", "cluster-name"), - ("app.kubernetes.io/managed-by", "my-operator_my-controller"), - ("app.kubernetes.io/name", "my-product"), - ("app.kubernetes.io/role-group", "my-role-group"), - ("app.kubernetes.io/version", "1.0.0"), - ("stackable.tech/vendor", "Stackable"), - ] - .map(|(k, v)| (k.to_owned(), v.to_owned())) - .into(); - - assert_eq!(expected_labels, actual_labels.into()); - } - - #[test] - fn test_role_selector() { - let actual_labels = role_selector( - &Cluster::new(), - &ProductName::from_str_unsafe("my-product"), - &RoleName::from_str_unsafe("my-role"), - ); - - let expected_labels: BTreeMap = [ - ("app.kubernetes.io/component", "my-role"), - ("app.kubernetes.io/instance", "cluster-name"), - ("app.kubernetes.io/name", "my-product"), - ] - .map(|(k, v)| (k.to_owned(), v.to_owned())) - .into(); - - assert_eq!(expected_labels, actual_labels.into()); - } - - #[test] - fn test_role_group_selector() { - let actual_labels = role_group_selector( - &Cluster::new(), - &ProductName::from_str_unsafe("my-product"), - &RoleName::from_str_unsafe("my-role"), - &RoleGroupName::from_str_unsafe("my-role-group"), - ); - - let expected_labels: BTreeMap = [ - ("app.kubernetes.io/component", "my-role"), - ("app.kubernetes.io/instance", "cluster-name"), - ("app.kubernetes.io/name", "my-product"), - ("app.kubernetes.io/role-group", "my-role-group"), - ] - .map(|(k, v)| (k.to_owned(), v.to_owned())) - .into(); - - assert_eq!(expected_labels, actual_labels.into()); - } -} diff --git a/rust/operator-binary/src/framework/macros.rs b/rust/operator-binary/src/framework/macros.rs deleted file mode 100644 index c25def95..00000000 --- a/rust/operator-binary/src/framework/macros.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod attributed_string_type; -pub mod constant; diff --git a/rust/operator-binary/src/framework/macros/attributed_string_type.rs b/rust/operator-binary/src/framework/macros/attributed_string_type.rs deleted file mode 100644 index 26085e94..00000000 --- a/rust/operator-binary/src/framework/macros/attributed_string_type.rs +++ /dev/null @@ -1,923 +0,0 @@ -use snafu::Snafu; -use strum::{EnumDiscriminants, IntoStaticStr}; - -/// Maximum length of label values -/// -/// Duplicates the private constant [`stackable_operator::kvp::LABEL_VALUE_MAX_LEN`] -pub const MAX_LABEL_VALUE_LENGTH: usize = 63; - -#[derive(Debug, EnumDiscriminants, Snafu)] -#[snafu(visibility(pub))] -#[strum_discriminants(derive(IntoStaticStr))] -pub enum Error { - #[snafu(display("minimum length not met"))] - MinimumLengthNotMet { length: usize, min_length: usize }, - - #[snafu(display("maximum length exceeded"))] - LengthExceeded { length: usize, max_length: usize }, - - #[snafu(display("invalid regular expression"))] - InvalidRegex { source: regex::Error }, - - #[snafu(display("regular expression not matched"))] - RegexNotMatched { value: String, regex: &'static str }, - - #[snafu(display("not a valid label value"))] - InvalidLabelValue { - source: stackable_operator::kvp::LabelValueError, - }, - - #[snafu(display("not a valid label name as defined in RFC 1035"))] - InvalidRfc1035LabelName { - source: stackable_operator::validation::Errors, - }, - - #[snafu(display("not a valid DNS subdomain name as defined in RFC 1123"))] - InvalidRfc1123DnsSubdomainName { - source: stackable_operator::validation::Errors, - }, - - #[snafu(display("not a valid label name as defined in RFC 1123"))] - InvalidRfc1123LabelName { - source: stackable_operator::validation::Errors, - }, - - #[snafu(display("not a valid UUID"))] - InvalidUid { source: uuid::Error }, -} - -/// Helper data type to determine combined regular expressions -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub enum Regex { - /// There is a regular expression but it is unknown (because it was too complicated to - /// calculate it). - Unknown, - - /// `MatchAll` equals `Expression(".*")`, but `MatchAll` can be pattern matched in a const - /// context, whereas `Expression(...)` cannot. - MatchAll, - - /// A regular expression - Expression(&'static str), -} - -impl Regex { - /// Combine this regular expression with the given one. - pub const fn combine(self, other: Regex) -> Regex { - match (self, other) { - (_, Regex::MatchAll) => self, - (Regex::MatchAll, _) => other, - // It is hard to combine two regular expressions and nearly impossible to do this in a - // const context. Fortunately, for most of the data types, only one regular expression - // is set. - _ => Regex::Unknown, - } - } -} - -/// Restricted string type with attributes like maximum length. -/// -/// Fully-qualified types are used to ease the import into other modules. -/// -/// # Examples -/// -/// ```rust -/// attributed_string_type! { -/// ConfigMapName, -/// "The name of a ConfigMap", -/// "opensearch-nodes-default", -/// is_rfc_1123_dns_subdomain_name -/// } -/// ``` -#[macro_export(local_inner_macros)] -macro_rules! attributed_string_type { - ($name:ident, $description:literal, $example:literal $(, $attribute:tt)*) => { - #[doc = std::concat!($description, ", e.g. \"", $example, "\"")] - #[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd)] - pub struct $name(String); - - impl $name { - /// The minimum length - pub const MIN_LENGTH: usize = attributed_string_type!(@min_length $($attribute)*); - - /// The maximum length - pub const MAX_LENGTH: usize = attributed_string_type!(@max_length $($attribute)*); - - /// The regular expression - /// - /// This field is not meant to be used outside of this macro. - pub const REGEX: $crate::framework::macros::attributed_string_type::Regex = attributed_string_type!(@regex $($attribute)*); - } - - impl stackable_operator::config::merge::Atomic for $name {} - - impl std::fmt::Display for $name { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - self.0.fmt(f) - } - } - - impl From<$name> for String { - fn from(value: $name) -> Self { - value.0 - } - } - - impl From<&$name> for String { - fn from(value: &$name) -> Self { - value.0.clone() - } - } - - impl AsRef for $name { - fn as_ref(&self) -> &str { - &self.0 - } - } - - impl std::str::FromStr for $name { - type Err = $crate::framework::macros::attributed_string_type::Error; - - fn from_str(s: &str) -> std::result::Result { - // ResultExt::context is used on most but not all usages of this macro - #[allow(unused_imports)] - use snafu::ResultExt; - - $(attributed_string_type!(@from_str $name, s, $attribute);)* - - Ok(Self(s.to_owned())) - } - } - - impl<'de> serde::Deserialize<'de> for $name { - fn deserialize(deserializer: D) -> Result - where - D: serde::Deserializer<'de>, - { - let string: String = serde::Deserialize::deserialize(deserializer)?; - $name::from_str(&string).map_err(|err| serde::de::Error::custom(&err)) - } - } - - impl serde::Serialize for $name { - fn serialize(&self, serializer: S) -> Result - where - S: serde::Serializer, - { - self.0.serialize(serializer) - } - } - - // The JsonSchema implementation requires `max_length`. - impl stackable_operator::schemars::JsonSchema for $name { - fn schema_name() -> std::borrow::Cow<'static, str> { - std::stringify!($name).into() - } - - fn json_schema(_generator: &mut stackable_operator::schemars::generate::SchemaGenerator) -> stackable_operator::schemars::Schema { - stackable_operator::schemars::json_schema!({ - "type": "string", - "minLength": $name::MIN_LENGTH, - "maxLength": if $name::MAX_LENGTH != usize::MAX { - Some($name::MAX_LENGTH) - } else { - // Do not set maxLength if it is usize::MAX. - None - }, - "pattern": match $name::REGEX { - $crate::framework::macros::attributed_string_type::Regex::Expression(regex) => Some(regex), - _ => None - } - }) - } - } - - #[cfg(test)] - impl $name { - #[allow(dead_code)] - pub fn from_str_unsafe(s: &str) -> Self { - std::str::FromStr::from_str(s).expect("should be a valid {name}") - } - - // A dead_code warning is emitted if there is no unit test that calls this function. - pub fn test_example() { - Self::from_str_unsafe($example); - } - } - - $(attributed_string_type!(@trait_impl $name, $attribute);)* - }; - - // std::str::FromStr - - (@from_str $name:ident, $s:expr, (min_length = $min_length:expr)) => { - let length = $s.len() as usize; - snafu::ensure!( - length >= $name::MIN_LENGTH, - $crate::framework::macros::attributed_string_type::MinimumLengthNotMetSnafu { - length, - min_length: $name::MIN_LENGTH, - } - ); - }; - (@from_str $name:ident, $s:expr, (max_length = $max_length:expr)) => { - let length = $s.len() as usize; - snafu::ensure!( - length <= $name::MAX_LENGTH, - $crate::framework::macros::attributed_string_type::LengthExceededSnafu { - length, - max_length: $name::MAX_LENGTH, - } - ); - }; - (@from_str $name:ident, $s:expr, (regex = $regex:expr)) => { - let regex = regex::Regex::new($regex).context($crate::framework::macros::attributed_string_type::InvalidRegexSnafu)?; - snafu::ensure!( - regex.is_match($s), - $crate::framework::macros::attributed_string_type::RegexNotMatchedSnafu { - value: $s, - regex: $regex - } - ); - }; - (@from_str $name:ident, $s:expr, is_rfc_1035_label_name) => { - stackable_operator::validation::is_lowercase_rfc_1035_label($s).context($crate::framework::macros::attributed_string_type::InvalidRfc1035LabelNameSnafu)?; - }; - (@from_str $name:ident, $s:expr, is_rfc_1123_dns_subdomain_name) => { - stackable_operator::validation::is_lowercase_rfc_1123_subdomain($s).context($crate::framework::macros::attributed_string_type::InvalidRfc1123DnsSubdomainNameSnafu)?; - }; - (@from_str $name:ident, $s:expr, is_rfc_1123_label_name) => { - stackable_operator::validation::is_lowercase_rfc_1123_label($s).context($crate::framework::macros::attributed_string_type::InvalidRfc1123LabelNameSnafu)?; - }; - (@from_str $name:ident, $s:expr, is_valid_label_value) => { - stackable_operator::kvp::LabelValue::from_str($s).context($crate::framework::macros::attributed_string_type::InvalidLabelValueSnafu)?; - }; - (@from_str $name:ident, $s:expr, is_uid) => { - uuid::Uuid::try_parse($s).context($crate::framework::macros::attributed_string_type::InvalidUidSnafu)?; - }; - - // MIN_LENGTH - - (@min_length) => { - // The minimum String length is 0. - 0 - }; - (@min_length (min_length = $min_length:expr) $($attribute:tt)*) => { - $crate::framework::macros::attributed_string_type::max( - $min_length, - attributed_string_type!(@min_length $($attribute)*) - ) - }; - (@min_length (max_length = $max_length:expr) $($attribute:tt)*) => { - // max_length has no opinion on the min_length. - attributed_string_type!(@min_length $($attribute)*) - }; - (@min_length (regex = $regex:expr) $($attribute:tt)*) => { - // regex has no influence on the min_length. - attributed_string_type!(@min_length $($attribute)*) - }; - (@min_length is_rfc_1035_label_name $($attribute:tt)*) => { - $crate::framework::macros::attributed_string_type::max( - 1, - attributed_string_type!(@min_length $($attribute)*) - ) - }; - (@min_length is_rfc_1123_dns_subdomain_name $($attribute:tt)*) => { - $crate::framework::macros::attributed_string_type::max( - 1, - attributed_string_type!(@min_length $($attribute)*) - ) - }; - (@min_length is_rfc_1123_label_name $($attribute:tt)*) => { - $crate::framework::macros::attributed_string_type::max( - 1, - attributed_string_type!(@min_length $($attribute)*) - ) - }; - (@min_length is_valid_label_value $($attribute:tt)*) => { - $crate::framework::macros::attributed_string_type::max( - 1, - attributed_string_type!(@min_length $($attribute)*) - ) - }; - (@min_length is_uid $($attribute:tt)*) => { - $crate::framework::macros::attributed_string_type::max( - uuid::fmt::Hyphenated::LENGTH, - attributed_string_type!(@min_length $($attribute)*) - ) - }; - - // MAX_LENGTH - - (@max_length) => { - // If there is no other max_length defined, then the upper bound is usize::MAX. - usize::MAX - }; - (@max_length (min_length = $min_length:expr) $($attribute:tt)*) => { - // min_length has no opinion on the max_length. - attributed_string_type!(@max_length $($attribute)*) - }; - (@max_length (max_length = $max_length:expr) $($attribute:tt)*) => { - $crate::framework::macros::attributed_string_type::min( - $max_length, - attributed_string_type!(@max_length $($attribute)*) - ) - }; - (@max_length (regex = $regex:expr) $($attribute:tt)*) => { - // regex has no influence on the max_length. - attributed_string_type!(@max_length $($attribute)*) - }; - (@max_length is_rfc_1035_label_name $($attribute:tt)*) => { - $crate::framework::macros::attributed_string_type::min( - stackable_operator::validation::RFC_1035_LABEL_MAX_LENGTH, - attributed_string_type!(@max_length $($attribute)*) - ) - }; - (@max_length is_rfc_1123_dns_subdomain_name $($attribute:tt)*) => { - $crate::framework::macros::attributed_string_type::min( - stackable_operator::validation::RFC_1123_SUBDOMAIN_MAX_LENGTH, - attributed_string_type!(@max_length $($attribute)*) - ) - }; - (@max_length is_rfc_1123_label_name $($attribute:tt)*) => { - $crate::framework::macros::attributed_string_type::min( - stackable_operator::validation::RFC_1123_LABEL_MAX_LENGTH, - attributed_string_type!(@max_length $($attribute)*) - ) - }; - (@max_length is_valid_label_value $($attribute:tt)*) => { - $crate::framework::macros::attributed_string_type::min( - $crate::framework::macros::attributed_string_type::MAX_LABEL_VALUE_LENGTH, - attributed_string_type!(@max_length $($attribute)*) - ) - }; - (@max_length is_uid $($attribute:tt)*) => { - $crate::framework::macros::attributed_string_type::min( - uuid::fmt::Hyphenated::LENGTH, - attributed_string_type!(@max_length $($attribute)*) - ) - }; - - // REGEX - - (@regex) => { - // Everything is allowed if there is no other regular expression. - $crate::framework::macros::attributed_string_type::Regex::MatchAll - }; - (@regex (min_length = $min_length:expr) $($attribute:tt)*) => { - // min_length has no influence on the regular expression. - attributed_string_type!(@regex $($attribute)*) - }; - (@regex (max_length = $max_length:expr) $($attribute:tt)*) => { - // max_length has no influence on the regular expression. - attributed_string_type!(@regex $($attribute)*) - }; - (@regex (regex = $regex:expr) $($attribute:tt)*) => { - $crate::framework::macros::attributed_string_type::Regex::Expression($regex) - .combine(attributed_string_type!(@regex $($attribute)*)) - }; - (@regex is_rfc_1035_label_name $($attribute:tt)*) => { - // see https://github.com/kubernetes/kubernetes/blob/v1.35.0/staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go#L228 - $crate::framework::macros::attributed_string_type::Regex::Expression("^[a-z]([-a-z0-9]*[a-z0-9])?$") - .combine(attributed_string_type!(@regex $($attribute)*)) - }; - (@regex is_rfc_1123_dns_subdomain_name $($attribute:tt)*) => { - // see https://github.com/kubernetes/kubernetes/blob/v1.35.0/staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go#L193 - $crate::framework::macros::attributed_string_type::Regex::Expression("^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$") - .combine(attributed_string_type!(@regex $($attribute)*)) - }; - (@regex is_rfc_1123_label_name $($attribute:tt)*) => { - // see https://github.com/kubernetes/kubernetes/blob/v1.35.0/staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go#L163 - $crate::framework::macros::attributed_string_type::Regex::Expression("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$") - .combine(attributed_string_type!(@regex $($attribute)*)) - }; - (@regex is_valid_label_value $($attribute:tt)*) => { - // regular expression from stackable_operator::kvp::label::LABEL_VALUE_REGEX - $crate::framework::macros::attributed_string_type::Regex::Expression("^[a-z0-9A-Z]([a-z0-9A-Z-_.]*[a-z0-9A-Z]+)?$") - .combine(attributed_string_type!(@regex $($attribute)*)) - }; - (@regex is_uid $($attribute:tt)*) => { - $crate::framework::macros::attributed_string_type::Regex::Expression("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") - .combine(attributed_string_type!(@regex $($attribute)*)) - }; - - // additional constants and trait implementations - - (@trait_impl $name:ident, (min_length = $max_length:expr)) => { - }; - (@trait_impl $name:ident, (max_length = $max_length:expr)) => { - }; - (@trait_impl $name:ident, (regex = $regex:expr)) => { - }; - (@trait_impl $name:ident, is_rfc_1035_label_name) => { - impl $name { - pub const IS_RFC_1035_LABEL_NAME: bool = true; - pub const IS_RFC_1123_LABEL_NAME: bool = true; - pub const IS_RFC_1123_SUBDOMAIN_NAME: bool = true; - } - }; - (@trait_impl $name:ident, is_rfc_1123_dns_subdomain_name) => { - impl $name { - pub const IS_RFC_1123_SUBDOMAIN_NAME: bool = true; - } - }; - (@trait_impl $name:ident, is_rfc_1123_label_name) => { - impl $name { - pub const IS_RFC_1123_LABEL_NAME: bool = true; - pub const IS_RFC_1123_SUBDOMAIN_NAME: bool = true; - } - }; - (@trait_impl $name:ident, is_valid_label_value) => { - impl $name { - pub const IS_VALID_LABEL_VALUE: bool = true; - } - - impl $crate::framework::NameIsValidLabelValue for $name { - fn to_label_value(&self) -> String { - self.0.clone() - } - } - }; - (@trait_impl $name:ident, is_uid) => { - impl From for $name { - fn from(value: uuid::Uuid) -> Self { - Self(value.to_string()) - } - } - - impl From<&uuid::Uuid> for $name { - fn from(value: &uuid::Uuid) -> Self { - Self(value.to_string()) - } - } - }; -} - -/// Returns the minimum of the given values. -/// -/// As opposed to [`std::cmp::min`], this function can be used at compile-time. -/// -/// # Examples -/// -/// ```rust -/// assert_eq!(2, min(2, 3)); -/// assert_eq!(4, min(5, 4)); -/// assert_eq!(1, min(1, 1)); -/// ``` -pub const fn min(x: usize, y: usize) -> usize { - if x < y { x } else { y } -} - -/// Returns the maximum of the given values. -/// -/// As opposed to [`std::cmp::max`], this function can be used at compile-time. -/// -/// # Examples -/// -/// ```rust -/// assert_eq!(3, max(2, 3)); -/// assert_eq!(5, max(5, 4)); -/// assert_eq!(1, max(1, 1)); -/// ``` -pub const fn max(x: usize, y: usize) -> usize { - if x < y { y } else { x } -} - -#[cfg(test)] -// `InvalidRegexTest` intentionally contains an invalid regular expression. -#[allow(clippy::invalid_regex)] -mod tests { - use std::str::FromStr; - - use serde_json::{Number, Value, json}; - use stackable_operator::schemars::{JsonSchema, SchemaGenerator}; - use uuid::uuid; - - use super::{ErrorDiscriminants, Regex}; - use crate::framework::NameIsValidLabelValue; - - attributed_string_type! { - MinLengthWithoutConstraintsTest, - "min_length test without constraints", - "" - } - - #[test] - fn test_attributed_string_type_min_length_without_constraints() { - type T = MinLengthWithoutConstraintsTest; - - T::test_example(); - assert_eq!(0, T::MIN_LENGTH); - } - - attributed_string_type! { - MinLengthWithConstraintsTest, - "min_length test with constraints", - "test", - (min_length = 2), // should set the minimum length to 2 - (max_length = 8), // should not affect the minimum length - (regex = "^.{4}$"), // should not affect the minimum length - is_rfc_1035_label_name, // should be overruled by the greater min_length - is_valid_label_value // should be overruled by the greater min_length - } - - #[test] - fn test_attributed_string_type_min_length_with_constraints() { - type T = MinLengthWithConstraintsTest; - - T::test_example(); - assert_eq!(2, T::MIN_LENGTH); - assert_eq!( - Err(ErrorDiscriminants::MinimumLengthNotMet), - T::from_str("a").map_err(ErrorDiscriminants::from) - ); - } - - attributed_string_type! { - MaxLengthWithoutConstraintsTest, - "max_length test without constraints", - "" - } - - #[test] - fn test_attributed_string_type_max_length_without_constraints() { - type T = MaxLengthWithoutConstraintsTest; - - T::test_example(); - assert_eq!(usize::MAX, T::MAX_LENGTH); - } - - attributed_string_type! { - MaxLengthWithConstraintsTest, - "max_length test with constraints", - "test", - (min_length = 2), // should not affect the maximum length - (max_length = 8), // should set the maximum length to 8 - (regex = "^.{4}$"), // should not affect the maximum length - is_rfc_1035_label_name, // should be overruled by the lower max_length - is_valid_label_value // should be overruled by the lower max_length - } - - #[test] - fn test_attributed_string_type_max_length_with_constraints() { - type T = MaxLengthWithConstraintsTest; - - T::test_example(); - assert_eq!(8, T::MAX_LENGTH); - assert_eq!( - Err(ErrorDiscriminants::LengthExceeded), - T::from_str("test-12345").map_err(ErrorDiscriminants::from) - ); - } - - attributed_string_type! { - RegexWithoutConstraintsTest, - "regex test without constraints", - "" - } - - #[test] - fn test_attributed_string_type_regex_without_constraints() { - type T = RegexWithoutConstraintsTest; - - T::test_example(); - assert_eq!(Regex::MatchAll, T::REGEX); - } - - attributed_string_type! { - RegexWithOneConstraintTest, - "regex test with one constraint", - "test", - (min_length = 2), // should not affect the regular expression - (max_length = 8), // should not affect the regular expression - (regex = "^[est]{4}$") // should set the regular expression to "[est]{4}" - } - - #[test] - fn test_attributed_string_type_regex_with_one_constraint() { - type T = RegexWithOneConstraintTest; - - T::test_example(); - assert_eq!(Regex::Expression("^[est]{4}$"), T::REGEX); - assert_eq!( - Err(ErrorDiscriminants::RegexNotMatched), - T::from_str("t-st").map_err(ErrorDiscriminants::from) - ); - } - - attributed_string_type! { - RegexWithMultipleConstraintsTest, - "regex test with multiple constraints", - "test", - (min_length = 2), // should not affect the regular expression - (max_length = 8), // should not affect the regular expression - (regex = "^[est]{4}$"), // should not be combinable with is_rfc_1123_dns_subdomain_name - is_rfc_1123_dns_subdomain_name // should not be combinable with regex - } - - #[test] - fn test_attributed_string_type_regex_with_multiple_constraints() { - type T = RegexWithMultipleConstraintsTest; - - T::test_example(); - assert_eq!(Regex::Unknown, T::REGEX); - assert_eq!( - Err(ErrorDiscriminants::RegexNotMatched), - T::from_str("t-st").map_err(ErrorDiscriminants::from) - ); - } - - attributed_string_type! { - InvalidRegexTest, - "regex test with invalid expression", - "test", - (min_length = 2), // should not affect the regular expression - (max_length = 8), // should not affect the regular expression - (regex = "{") // should throw an error at runtime - } - - #[test] - fn test_attributed_string_type_regex_with_invalid_expression() { - type T = InvalidRegexTest; - - // It is not known yet at compile-time that this expression is invalid. - assert_eq!(Regex::Expression("{"), T::REGEX); - assert_eq!( - Err(ErrorDiscriminants::InvalidRegex), - T::from_str("test").map_err(ErrorDiscriminants::from) - ); - } - - attributed_string_type! { - DisplayFmtTest, - "Display::fmt test", - "test" - } - - #[test] - fn test_attributed_string_type_display_fmt() { - type T = DisplayFmtTest; - - assert_eq!("test", format!("{}", T::from_str_unsafe("test"))); - } - - attributed_string_type! { - StringFromTest, - "String::from test", - "test" - } - - #[test] - fn test_attributed_string_type_string_from() { - type T = StringFromTest; - - T::test_example(); - assert_eq!("test", String::from(T::from_str_unsafe("test"))); - assert_eq!("test", String::from(&T::from_str_unsafe("test"))); - } - - attributed_string_type! { - DeserializeTest, - "serde::Deserialize test", - "test", - (min_length = 2), - (max_length = 4), - (regex = "^[est-]+$"), - is_rfc_1035_label_name - } - - #[test] - fn test_attributed_string_type_deserialize() { - type T = DeserializeTest; - - T::test_example(); - assert_eq!( - T::from_str_unsafe("test"), - serde_json::from_value(Value::String("test".to_owned())) - .expect("should be deserializable") - ); - assert_eq!( - Err("minimum length not met".to_owned()), - serde_json::from_value::(Value::String("e".to_owned())) - .map_err(|err| err.to_string()) - ); - assert_eq!( - Err("maximum length exceeded".to_owned()), - serde_json::from_value::(Value::String("testt".to_owned())) - .map_err(|err| err.to_string()) - ); - assert_eq!( - Err("regular expression not matched".to_owned()), - serde_json::from_value::(Value::String("abc".to_owned())) - .map_err(|err| err.to_string()) - ); - assert_eq!( - Err("not a valid label name as defined in RFC 1035".to_owned()), - serde_json::from_value::(Value::String("-tst".to_owned())) - .map_err(|err| err.to_string()) - ); - assert_eq!( - Err("invalid type: null, expected a string".to_owned()), - serde_json::from_value::(Value::Null).map_err(|err| err.to_string()) - ); - assert_eq!( - Err("invalid type: boolean `true`, expected a string".to_owned()), - serde_json::from_value::(Value::Bool(true)).map_err(|err| err.to_string()) - ); - assert_eq!( - Err("invalid type: integer `1`, expected a string".to_owned()), - serde_json::from_value::(Value::Number( - Number::from_i128(1).expect("should be a valid number") - )) - .map_err(|err| err.to_string()) - ); - assert_eq!( - Err("invalid type: sequence, expected a string".to_owned()), - serde_json::from_value::(Value::Array(vec![])).map_err(|err| err.to_string()) - ); - assert_eq!( - Err("invalid type: map, expected a string".to_owned()), - serde_json::from_value::(Value::Object(serde_json::Map::new())) - .map_err(|err| err.to_string()) - ); - } - - attributed_string_type! { - SerializeTest, - "serde::Serialize test", - "test" - } - - #[test] - fn test_attributed_string_type_serialize() { - type T = SerializeTest; - - T::test_example(); - assert_eq!( - "\"test\"".to_owned(), - serde_json::to_string(&T::from_str_unsafe("test")).expect("should be serializable") - ); - } - - attributed_string_type! { - JsonSchemaWithoutConstraintsTest, - "JsonSchema test with constraints", - "test" - } - - #[test] - fn test_attributed_string_type_json_schema_without_constaints() { - type T = JsonSchemaWithoutConstraintsTest; - - T::test_example(); - assert_eq!("JsonSchemaWithoutConstraintsTest", T::schema_name()); - assert_eq!( - json!({ - "type": "string", - "minLength": 0, - "maxLength": None::, - "pattern": None:: - }), - T::json_schema(&mut SchemaGenerator::default()) - ); - } - - attributed_string_type! { - JsonSchemaWithConstraintsTest, - "JsonSchema test with constraints", - "test", - (min_length = 4), - (max_length = 8), - (regex = "^[est]+$") - } - - #[test] - fn test_attributed_string_type_json_schema_with_constraints() { - type T = JsonSchemaWithConstraintsTest; - - T::test_example(); - assert_eq!("JsonSchemaWithConstraintsTest", T::schema_name()); - assert_eq!( - json!({ - "type": "string", - "minLength": 4, - "maxLength": 8, - "pattern": "^[est]+$" - }), - T::json_schema(&mut SchemaGenerator::default()) - ); - } - - attributed_string_type! { - IsRfc1035LabelNameTest, - "is_rfc_1035_label_name test", - "a-b", - is_rfc_1035_label_name - } - - #[test] - fn test_attributed_string_type_is_rfc_1035_label_name() { - type T = IsRfc1035LabelNameTest; - - let _ = T::IS_RFC_1035_LABEL_NAME; - let _ = T::IS_RFC_1123_LABEL_NAME; - let _ = T::IS_RFC_1123_SUBDOMAIN_NAME; - - T::test_example(); - assert_eq!( - Err(ErrorDiscriminants::InvalidRfc1035LabelName), - T::from_str("A").map_err(ErrorDiscriminants::from) - ); - } - - attributed_string_type! { - IsRfc1123DnsSubdomainNameTest, - "is_rfc_1123_dns_subdomain_name test", - "a-b.c", - is_rfc_1123_dns_subdomain_name - } - - #[test] - fn test_attributed_string_type_is_rfc_1123_dns_subdomain_name() { - type T = IsRfc1123DnsSubdomainNameTest; - - let _ = T::IS_RFC_1123_SUBDOMAIN_NAME; - - T::test_example(); - assert_eq!( - Err(ErrorDiscriminants::InvalidRfc1123DnsSubdomainName), - T::from_str("A").map_err(ErrorDiscriminants::from) - ); - } - - attributed_string_type! { - IsRfc1123LabelNameTest, - "is_rfc_1123_label_name test", - "1-a", - is_rfc_1123_label_name - } - - #[test] - fn test_attributed_string_type_is_rfc_1123_label_name() { - type T = IsRfc1123LabelNameTest; - - let _ = T::IS_RFC_1123_LABEL_NAME; - let _ = T::IS_RFC_1123_SUBDOMAIN_NAME; - - T::test_example(); - assert_eq!( - Err(ErrorDiscriminants::InvalidRfc1123LabelName), - T::from_str("A").map_err(ErrorDiscriminants::from) - ); - } - - attributed_string_type! { - IsValidLabelValueTest, - "is_valid_label_value test", - "a-_.1", - is_valid_label_value - } - - #[test] - fn test_attributed_string_type_is_valid_label_value() { - type T = IsValidLabelValueTest; - - let _ = T::IS_VALID_LABEL_VALUE; - - T::test_example(); - assert_eq!( - Err(ErrorDiscriminants::InvalidLabelValue), - T::from_str("invalid label value").map_err(ErrorDiscriminants::from) - ); - assert_eq!( - "label-value", - T::from_str_unsafe("label-value").to_label_value() - ); - } - - attributed_string_type! { - IsUidTest, - "is_uid test", - "c27b3971-ca72-42c1-80a4-abdfc1db0ddd", - is_uid - } - - #[test] - fn test_attributed_string_type_is_uid() { - type T = IsUidTest; - - T::test_example(); - assert_eq!( - Err(ErrorDiscriminants::InvalidUid), - T::from_str("invalid UID").map_err(ErrorDiscriminants::from) - ); - assert_eq!( - "c27b3971-ca72-42c1-80a4-abdfc1db0ddd", - T::from(uuid!("c27b3971-ca72-42c1-80a4-abdfc1db0ddd")).to_string() - ); - assert_eq!( - "c27b3971-ca72-42c1-80a4-abdfc1db0ddd", - T::from(&uuid!("c27b3971-ca72-42c1-80a4-abdfc1db0ddd")).to_string() - ); - } -} diff --git a/rust/operator-binary/src/framework/macros/constant.rs b/rust/operator-binary/src/framework/macros/constant.rs deleted file mode 100644 index ae4e9c69..00000000 --- a/rust/operator-binary/src/framework/macros/constant.rs +++ /dev/null @@ -1,17 +0,0 @@ -/// Use [`std::sync::LazyLock`] to define a static "constant" from a string. -/// -/// The string is converted into the given type with [`std::str::FromStr::from_str`]. -/// -/// # Examples -/// -/// ```rust -/// constant!(DATA_VOLUME_NAME: VolumeName = "data"); -/// constant!(pub CONFIG_VOLUME_NAME: VolumeName = "config"); -/// ``` -#[macro_export(local_inner_macros)] -macro_rules! constant { - ($qualifier:vis $name:ident: $type:ident = $value:literal) => { - $qualifier static $name: std::sync::LazyLock<$type> = - std::sync::LazyLock::new(|| $type::from_str($value).expect("should be a valid $name")); - }; -} diff --git a/rust/operator-binary/src/framework/product_logging.rs b/rust/operator-binary/src/framework/product_logging.rs deleted file mode 100644 index 0c717499..00000000 --- a/rust/operator-binary/src/framework/product_logging.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod framework; diff --git a/rust/operator-binary/src/framework/product_logging/framework.rs b/rust/operator-binary/src/framework/product_logging/framework.rs deleted file mode 100644 index fd88fb3e..00000000 --- a/rust/operator-binary/src/framework/product_logging/framework.rs +++ /dev/null @@ -1,502 +0,0 @@ -use std::{fmt::Display, str::FromStr}; - -use snafu::{OptionExt, ResultExt, Snafu}; -use stackable_operator::{ - builder::pod::{container::FieldPathEnvVar, resources::ResourceRequirementsBuilder}, - commons::product_image_selection::ResolvedProductImage, - k8s_openapi::api::core::v1::{Container, VolumeMount}, - product_logging::{ - framework::VECTOR_CONFIG_FILE, - spec::{ - AppenderConfig, AutomaticContainerLogConfig, ConfigMapLogConfig, - ContainerLogConfigChoice, CustomContainerLogConfig, LogLevel, Logging, - }, - }, -}; -use strum::{EnumDiscriminants, IntoStaticStr}; - -use crate::{ - constant, - framework::{ - builder::pod::container::{EnvVarName, EnvVarSet, new_container_builder}, - role_group_utils, - types::kubernetes::{ConfigMapKey, ConfigMapName, ContainerName, VolumeName}, - }, -}; - -// Copy of the private constant `stackable_operator::product_logging::framework::STACKABLE_CONFIG_DIR` -const STACKABLE_CONFIG_DIR: &str = "/stackable/config"; - -// Copy of the private constant `stackable_operator::product_logging::framework::VECTOR_LOG_DIR` -const VECTOR_CONTROL_DIR: &str = "_vector"; - -// Copy of the private constant `stackable_operator::product_logging::framework::VECTOR_STATE_DIR` -const VECTOR_STATE_DIR: &str = "_vector-state"; - -// Copy of the private constant `stackable_operator::product_logging::framework::SHUTDOWN_FILE` -const SHUTDOWN_FILE: &str = "shutdown"; - -// Public variant of `stackable_operator::product_logging::framework::STACKABLE_LOG_DIR` -/// Directory where the logs are stored -pub const STACKABLE_LOG_DIR: &str = "/stackable/log"; - -// Copy of the private constant `stackable_operator::product_logging::framework::VECTOR_AGGREGATOR_CM_KEY` -constant!(VECTOR_AGGREGATOR_CM_KEY: ConfigMapKey = "ADDRESS"); - -// Copy of the private constant `stackable_operator::product_logging::framework::VECTOR_AGGREGATOR_ADDRESS` -constant!(VECTOR_AGGREGATOR_ENV_NAME: EnvVarName = "VECTOR_AGGREGATOR_ADDRESS"); - -#[derive(Debug, EnumDiscriminants, Snafu)] -#[strum_discriminants(derive(IntoStaticStr))] -pub enum Error { - #[snafu(display("failed to get the container log configuration"))] - GetContainerLogConfiguration { container: String }, - - #[snafu(display("failed to parse the container name"))] - ParseContainerName { - source: crate::framework::macros::attributed_string_type::Error, - }, -} - -type Result = std::result::Result; - -/// Validated [`ContainerLogConfigChoice`] -/// -/// The ConfigMap name in the Custom variant is valid. -#[derive(Clone, Debug, PartialEq)] -pub enum ValidatedContainerLogConfigChoice { - Automatic(AutomaticContainerLogConfig), - Custom(ConfigMapName), -} - -/// Validated [`ContainerLogConfigChoice`] for the Vector container -/// -/// It includes the discovery ConfigMap name of the Vector aggregator. -#[derive(Clone, Debug, PartialEq)] -pub struct VectorContainerLogConfig { - pub log_config: ValidatedContainerLogConfigChoice, - pub vector_aggregator_config_map_name: ConfigMapName, -} - -/// Validates the log configuration of the container -pub fn validate_logging_configuration_for_container( - logging: &Logging, - container: T, -) -> Result -where - T: Clone + Display + Ord, -{ - let container_log_config_choice = logging - .containers - .get(&container) - .and_then(|container_log_config| container_log_config.choice.as_ref()) - // This should never happen because default configurations should have been set for all - // containers. - .context(GetContainerLogConfigurationSnafu { - container: container.to_string(), - })?; - - let validated_container_log_config_choice = match container_log_config_choice { - ContainerLogConfigChoice::Automatic(automatic_log_config) => { - ValidatedContainerLogConfigChoice::Automatic(automatic_log_config.clone()) - } - ContainerLogConfigChoice::Custom(CustomContainerLogConfig { - custom: ConfigMapLogConfig { config_map }, - }) => ValidatedContainerLogConfigChoice::Custom( - ConfigMapName::from_str(config_map).context(ParseContainerNameSnafu)?, - ), - }; - - Ok(validated_container_log_config_choice) -} - -/// Builds the Vector container -pub fn vector_container( - container_name: &ContainerName, - image: &ResolvedProductImage, - vector_container_log_config: &VectorContainerLogConfig, - resource_names: &role_group_utils::ResourceNames, - log_config_volume_name: &VolumeName, - log_volume_name: &VolumeName, - extra_env_vars: EnvVarSet, -) -> Container { - let log_level = if let ValidatedContainerLogConfigChoice::Automatic(log_config) = - &vector_container_log_config.log_config - { - log_config.root_log_level() - } else { - LogLevel::default() - }; - let vector_file_log_level = - if let ValidatedContainerLogConfigChoice::Automatic(AutomaticContainerLogConfig { - file: Some(AppenderConfig { - level: Some(log_level), - }), - .. - }) = vector_container_log_config.log_config - { - log_level - } else { - LogLevel::default() - }; - - let env_vars = EnvVarSet::new() - .with_value( - &EnvVarName::from_str_unsafe("CLUSTER_NAME"), - &resource_names.cluster_name, - ) - .with_value( - &EnvVarName::from_str_unsafe("DATA_DIR"), - format!("{STACKABLE_LOG_DIR}/{VECTOR_STATE_DIR}"), - ) - .with_value(&EnvVarName::from_str_unsafe("LOG_DIR"), STACKABLE_LOG_DIR) - .with_field_path( - &EnvVarName::from_str_unsafe("NAMESPACE"), - FieldPathEnvVar::Namespace, - ) - .with_value( - &EnvVarName::from_str_unsafe("ROLE_GROUP_NAME"), - &resource_names.role_group_name, - ) - .with_value( - &EnvVarName::from_str_unsafe("ROLE_NAME"), - &resource_names.role_name, - ) - .with_config_map_key_ref( - &VECTOR_AGGREGATOR_ENV_NAME, - &vector_container_log_config.vector_aggregator_config_map_name, - &VECTOR_AGGREGATOR_CM_KEY, - ) - .with_value( - &EnvVarName::from_str_unsafe("VECTOR_CONFIG_YAML"), - format!("{STACKABLE_CONFIG_DIR}/{VECTOR_CONFIG_FILE}"), - ) - .with_value( - &EnvVarName::from_str_unsafe("VECTOR_FILE_LOG_LEVEL"), - vector_file_log_level.to_vector_literal(), - ) - .with_value( - &EnvVarName::from_str_unsafe("VECTOR_LOG"), - log_level.to_vector_literal(), - ) - .merge(extra_env_vars); - - let resources = ResourceRequirementsBuilder::new() - .with_cpu_request("250m") - .with_cpu_limit("500m") - .with_memory_request("128Mi") - .with_memory_limit("128Mi") - .build(); - - new_container_builder(container_name) - .image_from_product_image(image) - .command(vec![ - "/bin/bash".to_string(), - "-x".to_string(), - "-euo".to_string(), - "pipefail".to_string(), - "-c".to_string(), - ]) - .args(vec![format!( - "mkdir --parents {STACKABLE_LOG_DIR}/{VECTOR_STATE_DIR}\n\ - # Vector will ignore SIGTERM (as PID != 1) and must be shut down by writing a shutdown trigger file\n\ - vector & vector_pid=$!\n\ - if [ ! -f \"{vector_control_directory}/{SHUTDOWN_FILE}\" ]; then\n\ - mkdir -p {vector_control_directory}\n\ - inotifywait -qq --event create {vector_control_directory};\n\ - fi\n\ - sleep 1\n\ - kill $vector_pid", - vector_control_directory = format!("{STACKABLE_LOG_DIR}/{VECTOR_CONTROL_DIR}"), - )]) - .add_env_vars(env_vars) - .add_volume_mounts([ - VolumeMount { - mount_path: format!( - "{STACKABLE_CONFIG_DIR}/{VECTOR_CONFIG_FILE}" - ), - name: log_config_volume_name.to_string(), - read_only: Some(true), - sub_path: Some(VECTOR_CONFIG_FILE.to_owned()), - ..VolumeMount::default() - }, - VolumeMount { - mount_path: STACKABLE_LOG_DIR.to_owned(), - name: log_volume_name.to_string(), - ..VolumeMount::default() - }, - ]) - .expect("The mount paths are statically defined and there should be no duplicates.") - .resources(resources) - .build() -} - -#[cfg(test)] -mod tests { - use std::str::FromStr; - - use pretty_assertions::assert_eq; - use serde_json::json; - use stackable_operator::{ - commons::product_image_selection::ResolvedProductImage, - kvp::LabelValue, - product_logging::spec::{ - AutomaticContainerLogConfig, ConfigMapLogConfig, ContainerLogConfig, - ContainerLogConfigChoice, CustomContainerLogConfig, Logging, - }, - }; - - use super::{ - ErrorDiscriminants, ValidatedContainerLogConfigChoice, VectorContainerLogConfig, - validate_logging_configuration_for_container, vector_container, - }; - use crate::framework::{ - builder::pod::container::{EnvVarName, EnvVarSet}, - role_group_utils, - types::{ - kubernetes::{ConfigMapName, ContainerName, VolumeName}, - operator::{ClusterName, RoleGroupName, RoleName}, - }, - }; - - #[test] - fn test_validate_logging_configuration_for_container_ok_automatic_log_config() { - let logging = Logging { - enable_vector_agent: false, - containers: [( - "container", - ContainerLogConfig { - choice: Some(ContainerLogConfigChoice::Automatic( - AutomaticContainerLogConfig::default(), - )), - }, - )] - .into(), - }; - - assert_eq!( - ValidatedContainerLogConfigChoice::Automatic(AutomaticContainerLogConfig::default()), - validate_logging_configuration_for_container(&logging, "container") - .expect("should be a valid log config") - ); - } - - #[test] - fn test_validate_logging_configuration_for_container_ok_custom_log_config() { - let logging = Logging { - enable_vector_agent: false, - containers: [( - "container", - ContainerLogConfig { - choice: Some(ContainerLogConfigChoice::Custom(CustomContainerLogConfig { - custom: ConfigMapLogConfig { - config_map: "valid-config-map-name".to_owned(), - }, - })), - }, - )] - .into(), - }; - - assert_eq!( - ValidatedContainerLogConfigChoice::Custom(ConfigMapName::from_str_unsafe( - "valid-config-map-name" - )), - validate_logging_configuration_for_container(&logging, "container") - .expect("should be a valid log config") - ); - } - - #[test] - fn test_validate_logging_configuration_for_container_err_get_container_log_configuration() { - let logging_without_container = Logging { - enable_vector_agent: false, - containers: [].into(), - }; - let logging_without_container_log_config_choice = Logging { - enable_vector_agent: false, - containers: [("container", ContainerLogConfig { choice: None })].into(), - }; - - assert_eq!( - Err(ErrorDiscriminants::GetContainerLogConfiguration), - validate_logging_configuration_for_container(&logging_without_container, "container") - .map_err(ErrorDiscriminants::from) - ); - - assert_eq!( - Err(ErrorDiscriminants::GetContainerLogConfiguration), - validate_logging_configuration_for_container( - &logging_without_container_log_config_choice, - "container" - ) - .map_err(ErrorDiscriminants::from) - ); - } - - #[test] - fn test_validate_logging_configuration_for_container_err_parse_container_name() { - let logging = Logging { - enable_vector_agent: false, - containers: [( - "container", - ContainerLogConfig { - choice: Some(ContainerLogConfigChoice::Custom(CustomContainerLogConfig { - custom: ConfigMapLogConfig { - config_map: "invalid ConfigMap name".to_owned(), - }, - })), - }, - )] - .into(), - }; - - assert_eq!( - Err(ErrorDiscriminants::ParseContainerName), - validate_logging_configuration_for_container(&logging, "container") - .map_err(ErrorDiscriminants::from) - ); - } - - #[test] - fn test_vector_container() { - let image = ResolvedProductImage { - product_version: "1.0.0".to_owned(), - app_version_label_value: LabelValue::from_str("1.0.0-stackable0.0.0-dev") - .expect("should be a valid label value"), - image: "oci.stackable.tech/sdp/product:1.0.0-stackable0.0.0-dev".to_string(), - image_pull_policy: "Always".to_owned(), - pull_secrets: None, - }; - - let vector_container_log_config = VectorContainerLogConfig { - log_config: ValidatedContainerLogConfigChoice::Automatic( - AutomaticContainerLogConfig::default(), - ), - vector_aggregator_config_map_name: ConfigMapName::from_str_unsafe("vector-aggregator"), - }; - - let resource_names = role_group_utils::ResourceNames { - cluster_name: ClusterName::from_str_unsafe("test-cluster"), - role_name: RoleName::from_str_unsafe("role"), - role_group_name: RoleGroupName::from_str_unsafe("role-group"), - }; - - let vector_container = vector_container( - &ContainerName::from_str_unsafe("vector"), - &image, - &vector_container_log_config, - &resource_names, - &VolumeName::from_str_unsafe("config"), - &VolumeName::from_str_unsafe("log"), - EnvVarSet::new().with_value(&EnvVarName::from_str_unsafe("CUSTOM_ENV"), "test"), - ); - - assert_eq!( - json!( - { - "args": [ - concat!( - "mkdir --parents /stackable/log/_vector-state\n", - "# Vector will ignore SIGTERM (as PID != 1) and must be shut down by writing a shutdown trigger file\n", - "vector & vector_pid=$!\n", - "if [ ! -f \"/stackable/log/_vector/shutdown\" ]; then\n", - "mkdir -p /stackable/log/_vector\n", - "inotifywait -qq --event create /stackable/log/_vector;\n", - "fi\n", - "sleep 1\n", - "kill $vector_pid" - ), - ], - "command": [ - "/bin/bash", - "-x", - "-euo", - "pipefail", - "-c", - ], - "env": [ - { - "name": "CLUSTER_NAME", - "value": "test-cluster", - }, - { - "name": "CUSTOM_ENV", - "value": "test", - }, - { - "name": "DATA_DIR", - "value": "/stackable/log/_vector-state", - }, - { - "name": "LOG_DIR", - "value": "/stackable/log", - }, - { - "name": "NAMESPACE", - "valueFrom": { - "fieldRef": { - "fieldPath": "metadata.namespace", - }, - }, - }, - { - "name": "ROLE_GROUP_NAME", - "value": "role-group", - }, - { - "name": "ROLE_NAME", - "value": "role", - }, - { - "name": "VECTOR_AGGREGATOR_ADDRESS", - "valueFrom": { - "configMapKeyRef": { - "key": "ADDRESS", - "name": "vector-aggregator", - }, - }, - }, - { - "name": "VECTOR_CONFIG_YAML", - "value": "/stackable/config/vector.yaml", - }, - { - "name": "VECTOR_FILE_LOG_LEVEL", - "value": "info", - }, - { - "name": "VECTOR_LOG", - "value": "info", - }, - ], - "image": "oci.stackable.tech/sdp/product:1.0.0-stackable0.0.0-dev", - "imagePullPolicy": "Always", - "name": "vector", - "resources": { - "limits": { - "cpu": "500m", - "memory": "128Mi", - }, - "requests": { - "cpu": "250m", - "memory": "128Mi", - }, - }, - "volumeMounts": [ - { - "mountPath": "/stackable/config/vector.yaml", - "name": "config", - "readOnly": true, - "subPath": "vector.yaml", - }, - { - "mountPath": "/stackable/log", - "name": "log", - }, - ], - }), - serde_json::to_value(vector_container).expect("should be serializable") - ); - } -} diff --git a/rust/operator-binary/src/framework/role_group_utils.rs b/rust/operator-binary/src/framework/role_group_utils.rs deleted file mode 100644 index cb21fafd..00000000 --- a/rust/operator-binary/src/framework/role_group_utils.rs +++ /dev/null @@ -1,153 +0,0 @@ -use std::str::FromStr; - -use super::types::{ - kubernetes::{ConfigMapName, ListenerName, ServiceName, StatefulSetName}, - operator::{ClusterName, RoleGroupName, RoleName}, -}; -use crate::attributed_string_type; - -attributed_string_type! { - QualifiedRoleGroupName, - "A qualified role group name consisting of the cluster name, role name and role-group name. It is a valid label name as defined in RFC 1035 that can be used e.g. as a name for a Service or a StatefulSet.", - "opensearch-nodes-default", - // Suffixes are added to produce resource names. According compile-time checks ensure that - // max_length cannot be set higher. - (max_length = 52), - is_rfc_1035_label_name, - is_valid_label_value -} - -/// Type-safe names for role-group resources -pub struct ResourceNames { - pub cluster_name: ClusterName, - pub role_name: RoleName, - pub role_group_name: RoleGroupName, -} - -impl ResourceNames { - /// Creates a qualified role group name in the format - /// `--` - fn qualified_role_group_name(&self) -> QualifiedRoleGroupName { - // compile-time checks - const _: () = assert!( - ClusterName::MAX_LENGTH - + 1 // dash - + RoleName::MAX_LENGTH - + 1 // dash - + RoleGroupName::MAX_LENGTH - <= QualifiedRoleGroupName::MAX_LENGTH, - "The string `--` must not exceed the limit \ - of RFC 1035 label names." - ); - // qualified_role_group_name is only an RFC 1035 label name if it starts with an - // alphabetic character, therefore cluster_name must also be an RFC 1035 label name. - // role_name and role_group_name and the middle of the qualified_role_group_name can - // be RFC 1123 label names because digits are allowed there. - let _ = ClusterName::IS_RFC_1035_LABEL_NAME; - let _ = RoleName::IS_RFC_1123_LABEL_NAME; - let _ = RoleGroupName::IS_RFC_1123_LABEL_NAME; - - QualifiedRoleGroupName::from_str(&format!( - "{}-{}-{}", - self.cluster_name, self.role_name, self.role_group_name, - )) - .expect("should be a valid QualifiedRoleGroupName") - } - - pub fn role_group_config_map(&self) -> ConfigMapName { - // compile-time check - const _: () = assert!( - QualifiedRoleGroupName::MAX_LENGTH <= ConfigMapName::MAX_LENGTH, - "The string `--` must not exceed the limit of \ - ConfigMap names." - ); - let _ = QualifiedRoleGroupName::IS_RFC_1123_SUBDOMAIN_NAME; - - ConfigMapName::from_str(self.qualified_role_group_name().as_ref()) - .expect("should be a valid ConfigMap name") - } - - pub fn stateful_set_name(&self) -> StatefulSetName { - // compile-time checks - const _: () = assert!( - QualifiedRoleGroupName::MAX_LENGTH <= StatefulSetName::MAX_LENGTH, - "The string `--` must not exceed the \ - limit of StatefulSet names." - ); - let _ = QualifiedRoleGroupName::IS_RFC_1123_LABEL_NAME; - let _ = QualifiedRoleGroupName::IS_VALID_LABEL_VALUE; - - StatefulSetName::from_str(self.qualified_role_group_name().as_ref()) - .expect("should be a valid StatefulSet name") - } - - pub fn headless_service_name(&self) -> ServiceName { - const SUFFIX: &str = "-headless"; - - // compile-time checks - const _: () = assert!( - QualifiedRoleGroupName::MAX_LENGTH + SUFFIX.len() <= ServiceName::MAX_LENGTH, - "The string `---headless` must not exceed the \ - limit of Service names." - ); - let _ = QualifiedRoleGroupName::IS_RFC_1035_LABEL_NAME; - let _ = QualifiedRoleGroupName::IS_VALID_LABEL_VALUE; - - ServiceName::from_str(&format!("{}{SUFFIX}", self.qualified_role_group_name())) - .expect("should be a valid Service name") - } - - pub fn listener_name(&self) -> ListenerName { - // compile-time checks - const _: () = assert!( - QualifiedRoleGroupName::MAX_LENGTH <= ListenerName::MAX_LENGTH, - "The string `--` must not exceed the limit of \ - Listener names." - ); - let _ = QualifiedRoleGroupName::IS_RFC_1123_SUBDOMAIN_NAME; - - ListenerName::from_str(self.qualified_role_group_name().as_ref()) - .expect("should be a valid Listener name") - } -} - -#[cfg(test)] -mod tests { - use super::{ClusterName, RoleGroupName, RoleName}; - use crate::framework::{ - role_group_utils::{QualifiedRoleGroupName, ResourceNames}, - types::kubernetes::{ConfigMapName, ListenerName, ServiceName, StatefulSetName}, - }; - - #[test] - fn test_resource_names() { - QualifiedRoleGroupName::test_example(); - - let resource_names = ResourceNames { - cluster_name: ClusterName::from_str_unsafe("test-cluster"), - role_name: RoleName::from_str_unsafe("data-nodes"), - role_group_name: RoleGroupName::from_str_unsafe("ssd-storage"), - }; - - assert_eq!( - QualifiedRoleGroupName::from_str_unsafe("test-cluster-data-nodes-ssd-storage"), - resource_names.qualified_role_group_name() - ); - assert_eq!( - ConfigMapName::from_str_unsafe("test-cluster-data-nodes-ssd-storage"), - resource_names.role_group_config_map() - ); - assert_eq!( - StatefulSetName::from_str_unsafe("test-cluster-data-nodes-ssd-storage"), - resource_names.stateful_set_name() - ); - assert_eq!( - ServiceName::from_str_unsafe("test-cluster-data-nodes-ssd-storage-headless"), - resource_names.headless_service_name() - ); - assert_eq!( - ListenerName::from_str_unsafe("test-cluster-data-nodes-ssd-storage"), - resource_names.listener_name() - ); - } -} diff --git a/rust/operator-binary/src/framework/role_utils.rs b/rust/operator-binary/src/framework/role_utils.rs deleted file mode 100644 index 1ff99ffc..00000000 --- a/rust/operator-binary/src/framework/role_utils.rs +++ /dev/null @@ -1,378 +0,0 @@ -use std::{ - collections::{BTreeMap, HashMap}, - str::FromStr, -}; - -use serde::{Deserialize, Serialize}; -use stackable_operator::{ - config::{ - fragment::{self, FromFragment}, - merge::{self, Merge, merge}, - }, - k8s_openapi::{DeepMerge, api::core::v1::PodTemplateSpec}, - role_utils::{CommonConfiguration, Role, RoleGroup}, - schemars::{self, JsonSchema}, -}; - -use super::{ - builder::pod::container::EnvVarSet, - types::{ - kubernetes::{ClusterRoleName, RoleBindingName, ServiceAccountName}, - operator::{ClusterName, ProductName}, - }, -}; - -// Variant of [`stackable_operator::role_utils::GenericCommonConfig`] that implements [`Merge`] -#[derive(Clone, Debug, Default, Deserialize, JsonSchema, PartialEq, Serialize)] -pub struct GenericCommonConfig {} - -impl Merge for GenericCommonConfig { - fn merge(&mut self, _defaults: &Self) {} -} - -/// Variant of [`stackable_operator::role_utils::RoleGroup`] that is easier to work with -/// -/// Differences are: -/// * `replicas` is non-optional. -/// * `config` is flattened. -/// * The [`HashMap`] in `env_overrides` is replaced with an [`EnvVarSet`]. -#[derive(Clone, Debug, PartialEq)] -pub struct RoleGroupConfig { - pub replicas: u16, - pub config: Config, - pub config_overrides: ConfigOverrides, - pub env_overrides: EnvVarSet, - pub cli_overrides: BTreeMap, - pub pod_overrides: PodTemplateSpec, - // allow(dead_code) is not necessary anymore when moved to operator-rs - #[allow(dead_code)] - pub product_specific_common_config: CommonConfig, -} - -impl RoleGroupConfig { - pub fn cli_overrides_to_vec(&self) -> Vec { - self.cli_overrides - .clone() - .into_iter() - .flat_map(|(option, value)| [option, value]) - .collect() - } -} - -/// Merges and validates the [`RoleGroup`] with the given `role` and `default_config` -pub fn with_validated_config( - role_group: &RoleGroup, - role: &Role, - default_config: &Config, -) -> Result, fragment::ValidationError> -where - ValidatedConfig: FromFragment, - CommonConfig: Clone + Default + JsonSchema + Merge + Serialize, - Config: Clone + Merge, - RoleConfig: Default + JsonSchema + Serialize, - ConfigOverrides: Clone + Default + JsonSchema + Merge + Serialize, -{ - let validated_config = role_group.validate_config(role, default_config)?; - Ok(RoleGroup { - config: CommonConfiguration { - config: validated_config, - config_overrides: merged_config_overrides( - &role.config.config_overrides, - role_group.config.config_overrides.clone(), - ), - env_overrides: merged_env_overrides( - role.config.env_overrides.clone(), - role_group.config.env_overrides.clone(), - ), - cli_overrides: merged_cli_overrides( - role.config.cli_overrides.clone(), - role_group.config.cli_overrides.clone(), - ), - pod_overrides: merged_pod_overrides( - role.config.pod_overrides.clone(), - role_group.config.pod_overrides.clone(), - ), - product_specific_common_config: merged_product_specific_common_config( - role.config.product_specific_common_config.clone(), - role_group.config.product_specific_common_config.clone(), - ), - }, - replicas: role_group.replicas, - }) -} - -fn merged_config_overrides( - role_config_overrides: &ConfigOverrides, - role_group_config_overrides: ConfigOverrides, -) -> ConfigOverrides -where - ConfigOverrides: Merge, -{ - merge::merge(role_group_config_overrides, role_config_overrides) -} - -fn merged_env_overrides( - role_env_overrides: HashMap, - role_group_env_overrides: HashMap, -) -> HashMap { - let mut merged_env_overrides = role_env_overrides; - merged_env_overrides.extend(role_group_env_overrides); - merged_env_overrides -} - -fn merged_cli_overrides( - role_cli_overrides: BTreeMap, - role_group_cli_overrides: BTreeMap, -) -> BTreeMap { - let mut merged_cli_overrides = role_cli_overrides; - merged_cli_overrides.extend(role_group_cli_overrides); - merged_cli_overrides -} - -fn merged_pod_overrides( - role_pod_overrides: PodTemplateSpec, - role_group_pod_overrides: PodTemplateSpec, -) -> PodTemplateSpec { - let mut merged_pod_overrides = role_pod_overrides; - merged_pod_overrides.merge_from(role_group_pod_overrides); - merged_pod_overrides -} - -fn merged_product_specific_common_config(role_config: T, role_group_config: T) -> T -where - T: Merge, -{ - merge(role_group_config, &role_config) -} - -/// Type-safe names for role resources -pub struct ResourceNames { - pub cluster_name: ClusterName, - pub product_name: ProductName, -} - -impl ResourceNames { - pub fn service_account_name(&self) -> ServiceAccountName { - const SUFFIX: &str = "-serviceaccount"; - - // compile-time checks - const _: () = assert!( - ClusterName::MAX_LENGTH + SUFFIX.len() <= ServiceAccountName::MAX_LENGTH, - "The string `-serviceaccount` must not exceed the limit of ServiceAccount names." - ); - let _ = ClusterName::IS_RFC_1123_SUBDOMAIN_NAME; - - ServiceAccountName::from_str(&format!("{}{SUFFIX}", self.cluster_name)) - .expect("should be a valid ServiceAccount name") - } - - pub fn role_binding_name(&self) -> RoleBindingName { - const SUFFIX: &str = "-rolebinding"; - - // compile-time checks - const _: () = assert!( - ClusterName::MAX_LENGTH + SUFFIX.len() <= RoleBindingName::MAX_LENGTH, - "The string `-rolebinding` must not exceed the limit of RoleBinding names." - ); - let _ = ClusterName::IS_RFC_1123_SUBDOMAIN_NAME; - - RoleBindingName::from_str(&format!("{}{SUFFIX}", self.cluster_name)) - .expect("should be a valid RoleBinding name") - } - - pub fn cluster_role_name(&self) -> ClusterRoleName { - const SUFFIX: &str = "-clusterrole"; - - // compile-time checks - const _: () = assert!( - ProductName::MAX_LENGTH + SUFFIX.len() <= ClusterRoleName::MAX_LENGTH, - "The string `-clusterrole` must not exceed the limit of cluster role names." - ); - let _ = ProductName::IS_RFC_1123_SUBDOMAIN_NAME; - - ClusterRoleName::from_str(&format!("{}{SUFFIX}", self.product_name)) - .expect("should be a valid cluster role name") - } -} - -#[cfg(test)] -mod tests { - use std::collections::{BTreeMap, HashMap}; - - use rstest::*; - use serde::Serialize; - use stackable_operator::{ - config::{fragment::Fragment, merge::Merge}, - k8s_openapi::api::core::v1::PodTemplateSpec, - kube::api::ObjectMeta, - role_utils::{CommonConfiguration, GenericRoleConfig, Role, RoleGroup}, - schemars::{self, JsonSchema}, - }; - - use super::ResourceNames; - use crate::framework::{ - config_overrides::KeyValueConfigOverrides, - role_utils::with_validated_config, - types::{ - kubernetes::{ClusterRoleName, RoleBindingName, ServiceAccountName}, - operator::{ClusterName, ProductName}, - }, - }; - - #[derive(Debug, Fragment, PartialEq)] - #[fragment_attrs(derive(Clone, Debug, Default, Merge, PartialEq))] - struct Config { - property: String, - } - - impl Config { - fn new(value: &str) -> Self { - Self { - property: value.to_owned(), - } - } - } - - impl ConfigFragment { - fn new(value: Option<&str>) -> Self { - Self { - property: value.map(str::to_owned), - } - } - } - - #[derive(Clone, Debug, Default, JsonSchema, Merge, PartialEq, Serialize)] - struct CommonConfig { - property: Option, - } - - fn new_common_config( - config: Config, - override_value: Option<&str>, - ) -> CommonConfiguration { - let mut config_file_overrides = BTreeMap::new(); - let mut env_overrides = HashMap::new(); - let mut cli_overrides = BTreeMap::new(); - - if let Some(value) = override_value { - config_file_overrides.insert("property".to_owned(), Some(value.to_owned())); - env_overrides.insert("PROPERTY".to_owned(), value.to_owned()); - cli_overrides.insert("--property".to_owned(), value.to_owned()); - } - - CommonConfiguration { - config, - config_overrides: KeyValueConfigOverrides { - overrides: config_file_overrides, - }, - env_overrides, - cli_overrides, - pod_overrides: PodTemplateSpec { - metadata: Some(ObjectMeta { - name: override_value.map(str::to_owned), - ..ObjectMeta::default() - }), - ..PodTemplateSpec::default() - }, - product_specific_common_config: CommonConfig { - property: override_value.map(str::to_owned), - }, - } - } - - #[rstest] - #[case( - "role-group", - Some("role-group"), - Some("role-group"), - Some("role"), - Some("default") - )] - #[case( - "role-group", - Some("role-group"), - Some("role-group"), - Some("role"), - None - )] - #[case( - "role-group", - Some("role-group"), - Some("role-group"), - None, - Some("default") - )] - #[case("role-group", Some("role-group"), Some("role-group"), None, None)] - #[case("role", Some("role"), None, Some("role"), Some("default"))] - #[case("role", Some("role"), None, Some("role"), None)] - #[case("default", None, None, None, Some("default"))] - fn test_with_validated_config_and_result_ok( - #[case] expected_config_value: &str, - #[case] expected_override_value: Option<&str>, - #[case] role_group_value: Option<&str>, - #[case] role_value: Option<&str>, - #[case] default_value: Option<&str>, - ) { - let role_group = RoleGroup { - config: new_common_config(ConfigFragment::new(role_group_value), role_group_value), - replicas: Some(3), - }; - let role = Role::<_, _, GenericRoleConfig, _> { - config: new_common_config(ConfigFragment::new(role_value), role_value), - ..Role::default() - }; - let default_config = ConfigFragment::new(default_value); - - let result = with_validated_config(&role_group, &role, &default_config); - - assert_eq!( - Some(RoleGroup { - config: new_common_config( - Config::new(expected_config_value), - expected_override_value - ), - replicas: Some(3) - }), - result.ok() - ) - } - - #[test] - fn test_with_validated_config_and_result_err() { - let role_group = RoleGroup { - config: new_common_config(ConfigFragment::new(None), None), - replicas: None, - }; - let role = Role::<_, _, GenericRoleConfig, _> { - config: new_common_config(ConfigFragment::new(None), None), - ..Role::default() - }; - let default_config = ConfigFragment::new(None); - - let result: Result, _> = - with_validated_config(&role_group, &role, &default_config); - - assert!(result.is_err()) - } - - #[test] - fn test_resource_names() { - let resource_names = ResourceNames { - cluster_name: ClusterName::from_str_unsafe("my-cluster"), - product_name: ProductName::from_str_unsafe("my-product"), - }; - - assert_eq!( - ServiceAccountName::from_str_unsafe("my-cluster-serviceaccount"), - resource_names.service_account_name() - ); - assert_eq!( - RoleBindingName::from_str_unsafe("my-cluster-rolebinding"), - resource_names.role_binding_name() - ); - assert_eq!( - ClusterRoleName::from_str_unsafe("my-product-clusterrole"), - resource_names.cluster_role_name() - ); - } -} diff --git a/rust/operator-binary/src/framework/types.rs b/rust/operator-binary/src/framework/types.rs deleted file mode 100644 index 65f61166..00000000 --- a/rust/operator-binary/src/framework/types.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub mod common; -pub mod kubernetes; -pub mod operator; diff --git a/rust/operator-binary/src/framework/types/common.rs b/rust/operator-binary/src/framework/types/common.rs deleted file mode 100644 index 3d7326ef..00000000 --- a/rust/operator-binary/src/framework/types/common.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! Common types that do not belong (yet) to a more specific module -use snafu::{ResultExt, Snafu}; -use strum::{EnumDiscriminants, IntoStaticStr}; - -#[derive(Snafu, Debug, EnumDiscriminants)] -#[strum_discriminants(derive(IntoStaticStr))] -pub enum Error { - #[snafu(display("failed to convert to port number"))] - ConvertToPortNumber { source: std::num::TryFromIntError }, -} - -/// A port number -#[derive(Clone, Debug, Eq, PartialEq)] -pub struct Port(pub u16); - -impl std::fmt::Display for Port { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - self.0.fmt(f) - } -} - -impl From for Port { - fn from(value: u16) -> Self { - Port(value) - } -} - -impl From for i32 { - fn from(value: Port) -> Self { - value.0 as i32 - } -} - -impl TryFrom for Port { - type Error = Error; - - fn try_from(value: i32) -> Result { - Ok(Port( - u16::try_from(value).context(ConvertToPortNumberSnafu)?, - )) - } -} - -#[cfg(test)] -mod tests { - - use super::{ErrorDiscriminants, Port}; - - #[test] - fn test_port_fmt() { - assert_eq!("0".to_owned(), Port(0).to_string()); - assert_eq!("65535".to_owned(), Port(65535).to_string()); - } - - #[test] - fn test_port_try_from_i32() { - assert_eq!(Some(Port(0)), Port::try_from(0).ok()); - assert_eq!(Some(Port(65535)), Port::try_from(65535).ok()); - assert_eq!( - Err(ErrorDiscriminants::ConvertToPortNumber), - Port::try_from(-1).map_err(ErrorDiscriminants::from) - ); - assert_eq!( - Err(ErrorDiscriminants::ConvertToPortNumber), - Port::try_from(65536).map_err(ErrorDiscriminants::from) - ); - } -} diff --git a/rust/operator-binary/src/framework/types/kubernetes.rs b/rust/operator-binary/src/framework/types/kubernetes.rs deleted file mode 100644 index 861e8a9c..00000000 --- a/rust/operator-binary/src/framework/types/kubernetes.rs +++ /dev/null @@ -1,191 +0,0 @@ -//! Kubernetes (resource) names -use std::str::FromStr; - -use stackable_operator::validation::{RFC_1123_LABEL_MAX_LENGTH, RFC_1123_SUBDOMAIN_MAX_LENGTH}; - -use crate::attributed_string_type; - -attributed_string_type! { - ConfigMapName, - "The name of a ConfigMap", - "opensearch-nodes-default", - is_rfc_1123_dns_subdomain_name -} - -attributed_string_type! { - ConfigMapKey, - "The key for a ConfigMap", - "log4j2.properties", - (min_length = 1), - // see https://github.com/kubernetes/kubernetes/blob/v1.34.1/staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go#L435-L451 - (max_length = RFC_1123_SUBDOMAIN_MAX_LENGTH), - (regex = "^[-._a-zA-Z0-9]+$") -} - -attributed_string_type! { - ContainerName, - "The name of a container in a Pod", - "opensearch", - is_rfc_1123_label_name -} - -attributed_string_type! { - ClusterRoleName, - "The name of a ClusterRole", - "opensearch-clusterrole", - // On the one hand, ClusterRoles must only contain characters that are allowed for DNS - // subdomain names, on the other hand, their length does not seem to be restricted – at least - // on Kind. However, 253 characters are sufficient for the Stackable operators, and to avoid - // problems on other Kubernetes providers, the length is restricted here. - is_rfc_1123_dns_subdomain_name -} - -attributed_string_type! { - Hostname, - "A hostname", - "example.com", - (min_length = 1), - (max_length = 253), - // see https://en.wikipedia.org/wiki/Hostname#Syntax - (regex = "^[a-zA-Z0-9]([-a-zA-Z0-9]{0,60}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([-a-zA-Z0-9]{0,60}[a-zA-Z0-9])?)*\\.?$") -} - -attributed_string_type! { - ListenerName, - "The name of a Listener", - "opensearch-nodes-default", - is_rfc_1123_dns_subdomain_name -} - -attributed_string_type! { - ListenerClassName, - "The name of a Listener", - "external-stable", - is_rfc_1123_dns_subdomain_name -} - -attributed_string_type! { - NamespaceName, - "The name of a Namespace", - "stackable-operators", - is_rfc_1123_label_name, - is_valid_label_value -} - -attributed_string_type! { - PersistentVolumeClaimName, - "The name of a PersistentVolumeClaim", - "config", - is_rfc_1123_dns_subdomain_name -} - -attributed_string_type! { - RoleBindingName, - "The name of a RoleBinding", - "opensearch-rolebinding", - // On the one hand, RoleBindings must only contain characters that are allowed for DNS - // subdomain names, on the other hand, their length does not seem to be restricted – at least - // on Kind. However, 253 characters are sufficient for the Stackable operators, and to avoid - // problems on other Kubernetes providers, the length is restricted here. - is_rfc_1123_dns_subdomain_name -} - -attributed_string_type! { - SecretClassName, - "The name of a SecretClass", - "tls", - // The secret class name is used in an annotation on the tls volume. - is_rfc_1123_dns_subdomain_name -} - -attributed_string_type! { - SecretKey, - "The key for a Secret", - "accessKey", - (min_length = 1), - // see https://github.com/kubernetes/kubernetes/blob/v1.34.1/staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go#L435-L451 - (max_length = RFC_1123_SUBDOMAIN_MAX_LENGTH), - (regex = "^[-._a-zA-Z0-9]+$") -} - -attributed_string_type! { - SecretName, - "The name of a Secret", - "opensearch-security-config", - is_rfc_1123_dns_subdomain_name -} - -attributed_string_type! { - ServiceAccountName, - "The name of a ServiceAccount", - "opensearch-serviceaccount", - is_rfc_1123_dns_subdomain_name -} - -attributed_string_type! { - ServiceName, - "The name of a Service", - "opensearch-nodes-default-headless", - is_rfc_1035_label_name, - is_valid_label_value -} - -attributed_string_type! { - StatefulSetName, - "The name of a StatefulSet", - "opensearch-nodes-default", - (max_length = - // see https://github.com/kubernetes/kubernetes/issues/64023 - RFC_1123_LABEL_MAX_LENGTH - - 1 /* dash */ - - 10 /* digits for the controller-revision-hash label */), - is_rfc_1123_label_name, - is_valid_label_value -} - -attributed_string_type! { - Uid, - "A UID", - "c27b3971-ca72-42c1-80a4-abdfc1db0ddd", - is_uid, - is_valid_label_value -} - -attributed_string_type! { - VolumeName, - "The name of a Volume", - "opensearch-nodes-default", - is_rfc_1123_label_name, - is_valid_label_value -} - -#[cfg(test)] -mod tests { - use super::{ - ClusterRoleName, ConfigMapKey, ConfigMapName, ContainerName, Hostname, ListenerClassName, - ListenerName, NamespaceName, PersistentVolumeClaimName, RoleBindingName, SecretClassName, - SecretKey, SecretName, ServiceAccountName, ServiceName, StatefulSetName, Uid, VolumeName, - }; - - #[test] - fn test_attributed_string_type_examples() { - ConfigMapName::test_example(); - ConfigMapKey::test_example(); - ContainerName::test_example(); - ClusterRoleName::test_example(); - Hostname::test_example(); - ListenerName::test_example(); - ListenerClassName::test_example(); - NamespaceName::test_example(); - PersistentVolumeClaimName::test_example(); - RoleBindingName::test_example(); - SecretClassName::test_example(); - SecretKey::test_example(); - SecretName::test_example(); - ServiceAccountName::test_example(); - ServiceName::test_example(); - StatefulSetName::test_example(); - Uid::test_example(); - VolumeName::test_example(); - } -} diff --git a/rust/operator-binary/src/framework/types/operator.rs b/rust/operator-binary/src/framework/types/operator.rs deleted file mode 100644 index 8ebb09fc..00000000 --- a/rust/operator-binary/src/framework/types/operator.rs +++ /dev/null @@ -1,91 +0,0 @@ -//! Names for operators - -use std::str::FromStr; - -use crate::attributed_string_type; - -attributed_string_type! { - ProductName, - "The name of a product", - "opensearch", - // A suffix is added to produce a label value. An according compile-time check ensures that - // max_length cannot be set higher. - (max_length = 54), - is_rfc_1123_dns_subdomain_name, - is_valid_label_value -} - -attributed_string_type! { - ProductVersion, - "The version of a product", - "3.4.0", - is_valid_label_value -} - -attributed_string_type! { - ClusterName, - "The name of a cluster/stacklet", - "my-opensearch-cluster", - // Suffixes are added to produce resource names. According compile-time checks ensure that - // max_length cannot be set higher. - (max_length = 24), - is_rfc_1035_label_name, - is_valid_label_value -} - -attributed_string_type! { - ControllerName, - "The name of a controller in an operator", - "opensearchcluster", - is_valid_label_value -} - -attributed_string_type! { - OperatorName, - "The name of an operator", - "opensearch.stackable.tech", - is_valid_label_value -} - -attributed_string_type! { - RoleGroupName, - "The name of a role-group name", - "cluster-manager", - // The role-group name is used to produce resource names. To make sure that all resource names - // are valid, max_length is restricted. Compile-time checks ensure that max_length cannot be - // set higher if not other names like the RoleName are set lower accordingly. - (max_length = 16), - is_rfc_1123_label_name, - is_valid_label_value -} - -attributed_string_type! { - RoleName, - "The name of a role name", - "nodes", - // The role name is used to produce resource names. To make sure that all resource names are - // valid, max_length is restricted. Compile-time checks ensure that max_length cannot be set - // higher if not other names like the RoleGroupName are set lower accordingly. - (max_length = 10), - is_rfc_1123_label_name, - is_valid_label_value -} - -#[cfg(test)] -mod tests { - use super::{ - ClusterName, ControllerName, OperatorName, ProductName, ProductVersion, RoleGroupName, - RoleName, - }; - - #[test] - fn test_attributed_string_type_examples() { - ProductName::test_example(); - ProductVersion::test_example(); - ClusterName::test_example(); - ControllerName::test_example(); - OperatorName::test_example(); - RoleGroupName::test_example(); - RoleName::test_example(); - } -} diff --git a/rust/operator-binary/src/main.rs b/rust/operator-binary/src/main.rs index b06ba779..3b9bb6f1 100644 --- a/rust/operator-binary/src/main.rs +++ b/rust/operator-binary/src/main.rs @@ -5,7 +5,6 @@ use std::{str::FromStr, sync::Arc}; use clap::Parser as _; use crd::{OpenSearchCluster, OpenSearchClusterVersion, v1alpha1}; -use framework::types::operator::OperatorName; use futures::{FutureExt, StreamExt}; use snafu::{ResultExt, Snafu, futures::TryFutureExt}; use stackable_operator::{ @@ -32,12 +31,12 @@ use stackable_operator::{ shared::yaml::SerializeOptions, telemetry::Tracing, utils::signal::{self, SignalWatcher}, + v2::types::operator::OperatorName, }; use strum::{EnumDiscriminants, IntoStaticStr}; mod controller; mod crd; -mod framework; mod webhooks; mod built_info { From 04bff1f8fb41c99c6cc475c1122693bd170b2a19 Mon Sep 17 00:00:00 2001 From: Siegfried Weber Date: Thu, 18 Jun 2026 14:51:04 +0200 Subject: [PATCH 02/10] Use constants for environment variable names --- Cargo.lock | 18 +++--- Cargo.nix | 36 +++++------ crate-hashes.json | 18 +++--- .../src/controller/build/node_config.rs | 49 +++++++++++---- .../build/product_logging/config.rs | 18 +++++- .../controller/build/role_group_builder.rs | 59 +++++++++---------- .../src/controller/validate.rs | 2 +- 7 files changed, 120 insertions(+), 80 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9bb2ffdf..10d33625 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1532,7 +1532,7 @@ dependencies = [ [[package]] name = "k8s-version" version = "0.1.3" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#f3a0923138059bfdfe1bb7115341c85187167e86" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#365ccb529aa1e6d30faa7c104a169c4f5329d9c2" dependencies = [ "darling", "regex", @@ -2923,7 +2923,7 @@ checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "stackable-certs" version = "0.4.0" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#f3a0923138059bfdfe1bb7115341c85187167e86" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#365ccb529aa1e6d30faa7c104a169c4f5329d9c2" dependencies = [ "const-oid", "ecdsa", @@ -2969,7 +2969,7 @@ dependencies = [ [[package]] name = "stackable-operator" version = "0.111.1" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#f3a0923138059bfdfe1bb7115341c85187167e86" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#365ccb529aa1e6d30faa7c104a169c4f5329d9c2" dependencies = [ "base64", "clap", @@ -3014,7 +3014,7 @@ dependencies = [ [[package]] name = "stackable-operator-derive" version = "0.3.1" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#f3a0923138059bfdfe1bb7115341c85187167e86" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#365ccb529aa1e6d30faa7c104a169c4f5329d9c2" dependencies = [ "darling", "proc-macro2", @@ -3025,7 +3025,7 @@ dependencies = [ [[package]] name = "stackable-shared" version = "0.1.1" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#f3a0923138059bfdfe1bb7115341c85187167e86" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#365ccb529aa1e6d30faa7c104a169c4f5329d9c2" dependencies = [ "jiff", "k8s-openapi", @@ -3042,7 +3042,7 @@ dependencies = [ [[package]] name = "stackable-telemetry" version = "0.6.4" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#f3a0923138059bfdfe1bb7115341c85187167e86" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#365ccb529aa1e6d30faa7c104a169c4f5329d9c2" dependencies = [ "axum", "clap", @@ -3066,7 +3066,7 @@ dependencies = [ [[package]] name = "stackable-versioned" version = "0.10.0" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#f3a0923138059bfdfe1bb7115341c85187167e86" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#365ccb529aa1e6d30faa7c104a169c4f5329d9c2" dependencies = [ "kube", "schemars", @@ -3080,7 +3080,7 @@ dependencies = [ [[package]] name = "stackable-versioned-macros" version = "0.10.0" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#f3a0923138059bfdfe1bb7115341c85187167e86" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#365ccb529aa1e6d30faa7c104a169c4f5329d9c2" dependencies = [ "convert_case", "convert_case_extras", @@ -3098,7 +3098,7 @@ dependencies = [ [[package]] name = "stackable-webhook" version = "0.9.1" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#f3a0923138059bfdfe1bb7115341c85187167e86" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#365ccb529aa1e6d30faa7c104a169c4f5329d9c2" dependencies = [ "arc-swap", "async-trait", diff --git a/Cargo.nix b/Cargo.nix index 3240d986..81e93247 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -4884,8 +4884,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech//operator-rs.git"; - rev = "f3a0923138059bfdfe1bb7115341c85187167e86"; - sha256 = "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x"; + rev = "365ccb529aa1e6d30faa7c104a169c4f5329d9c2"; + sha256 = "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj"; }; libName = "k8s_version"; authors = [ @@ -9604,8 +9604,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech//operator-rs.git"; - rev = "f3a0923138059bfdfe1bb7115341c85187167e86"; - sha256 = "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x"; + rev = "365ccb529aa1e6d30faa7c104a169c4f5329d9c2"; + sha256 = "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj"; }; libName = "stackable_certs"; authors = [ @@ -9809,8 +9809,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech//operator-rs.git"; - rev = "f3a0923138059bfdfe1bb7115341c85187167e86"; - sha256 = "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x"; + rev = "365ccb529aa1e6d30faa7c104a169c4f5329d9c2"; + sha256 = "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj"; }; libName = "stackable_operator"; authors = [ @@ -10008,8 +10008,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech//operator-rs.git"; - rev = "f3a0923138059bfdfe1bb7115341c85187167e86"; - sha256 = "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x"; + rev = "365ccb529aa1e6d30faa7c104a169c4f5329d9c2"; + sha256 = "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj"; }; procMacro = true; libName = "stackable_operator_derive"; @@ -10043,8 +10043,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech//operator-rs.git"; - rev = "f3a0923138059bfdfe1bb7115341c85187167e86"; - sha256 = "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x"; + rev = "365ccb529aa1e6d30faa7c104a169c4f5329d9c2"; + sha256 = "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj"; }; libName = "stackable_shared"; authors = [ @@ -10124,8 +10124,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech//operator-rs.git"; - rev = "f3a0923138059bfdfe1bb7115341c85187167e86"; - sha256 = "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x"; + rev = "365ccb529aa1e6d30faa7c104a169c4f5329d9c2"; + sha256 = "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj"; }; libName = "stackable_telemetry"; authors = [ @@ -10234,8 +10234,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech//operator-rs.git"; - rev = "f3a0923138059bfdfe1bb7115341c85187167e86"; - sha256 = "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x"; + rev = "365ccb529aa1e6d30faa7c104a169c4f5329d9c2"; + sha256 = "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj"; }; libName = "stackable_versioned"; authors = [ @@ -10284,8 +10284,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech//operator-rs.git"; - rev = "f3a0923138059bfdfe1bb7115341c85187167e86"; - sha256 = "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x"; + rev = "365ccb529aa1e6d30faa7c104a169c4f5329d9c2"; + sha256 = "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj"; }; procMacro = true; libName = "stackable_versioned_macros"; @@ -10352,8 +10352,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech//operator-rs.git"; - rev = "f3a0923138059bfdfe1bb7115341c85187167e86"; - sha256 = "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x"; + rev = "365ccb529aa1e6d30faa7c104a169c4f5329d9c2"; + sha256 = "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj"; }; libName = "stackable_webhook"; authors = [ diff --git a/crate-hashes.json b/crate-hashes.json index 7ea4be27..1e9f53e9 100644 --- a/crate-hashes.json +++ b/crate-hashes.json @@ -1,12 +1,12 @@ { - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#k8s-version@0.1.3": "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x", - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-certs@0.4.0": "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x", - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-operator-derive@0.3.1": "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x", - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-operator@0.111.1": "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x", - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-shared@0.1.1": "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x", - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-telemetry@0.6.4": "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x", - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-versioned-macros@0.10.0": "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x", - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-versioned@0.10.0": "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x", - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-webhook@0.9.1": "0kg50f12jzp6d0aa36i3kd3r3whw62znkkf5l0gm0d18gmf4kg1x", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#k8s-version@0.1.3": "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-certs@0.4.0": "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-operator-derive@0.3.1": "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-operator@0.111.1": "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-shared@0.1.1": "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-telemetry@0.6.4": "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-versioned-macros@0.10.0": "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-versioned@0.10.0": "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-webhook@0.9.1": "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj", "git+https://github.com/stackabletech/product-config.git?tag=0.8.0#product-config@0.8.0": "1dz70kapm2wdqcr7ndyjji0lhsl98bsq95gnb2lw487wf6yr7987" } \ No newline at end of file diff --git a/rust/operator-binary/src/controller/build/node_config.rs b/rust/operator-binary/src/controller/build/node_config.rs index cd2d20cb..03891131 100644 --- a/rust/operator-binary/src/controller/build/node_config.rs +++ b/rust/operator-binary/src/controller/build/node_config.rs @@ -1,9 +1,12 @@ //! Configuration of an OpenSearch node +use std::str::FromStr; + use serde_json::json; use stackable_operator::{ builder::pod::container::FieldPathEnvVar, commons::networking::DomainName, + constant, k8s_openapi::DeepMerge, v2::{ builder::pod::container::{EnvVarName, EnvVarSet}, @@ -140,6 +143,17 @@ const CONFIG_OPTION_TRANSPORT_PUBLISH_HOST: &str = "transport.publish_host"; const DEFAULT_OPENSEARCH_HOME: &str = "/stackable/opensearch"; +constant!(ENV_VAR_NAME_DISCOVERY_SEED_HOSTS: EnvVarName = CONFIG_OPTION_DISCOVERY_SEED_HOSTS); +constant!(ENV_VAR_NAME_HTTP_PUBLISH_HOST: EnvVarName = CONFIG_OPTION_HTTP_PUBLISH_HOST); +constant!(ENV_VAR_NAME_INITIAL_CLUSTER_MANAGER_NODES: EnvVarName = CONFIG_OPTION_INITIAL_CLUSTER_MANAGER_NODES); +constant!(ENV_VAR_NAME_NETWORK_PUBLISH_HOST: EnvVarName = CONFIG_OPTION_NETWORK_PUBLISH_HOST); +constant!(ENV_VAR_NAME_NODE_NAME: EnvVarName = CONFIG_OPTION_NODE_NAME); +constant!(ENV_VAR_NAME_NODE_ROLES: EnvVarName = CONFIG_OPTION_NODE_ROLES); +constant!(ENV_VAR_NAME_OPENSEARCH_HOME: EnvVarName = "OPENSEARCH_HOME"); +constant!(ENV_VAR_NAME_OPENSEARCH_PATH_CONF: EnvVarName = "OPENSEARCH_PATH_CONF"); +constant!(ENV_VAR_NAME_POD_NAME: EnvVarName = "_POD_NAME"); +constant!(ENV_VAR_NAME_TRANSPORT_PUBLISH_HOST: EnvVarName = CONFIG_OPTION_TRANSPORT_PUBLISH_HOST); + /// Configuration of an OpenSearch node based on the cluster and role-group configuration pub struct NodeConfig { cluster: ValidatedCluster, @@ -295,36 +309,36 @@ impl NodeConfig { .with_field_path( // Prefix with an underscore, so that it occurs before the other environment // variables which depend on it. - &EnvVarName::from_str_unsafe("_POD_NAME"), + &ENV_VAR_NAME_POD_NAME, &FieldPathEnvVar::Name, ) // Set the OpenSearch node name to the Pod name. // The node name is used e.g. for INITIAL_CLUSTER_MANAGER_NODES. .with_field_path( - &EnvVarName::from_str_unsafe(CONFIG_OPTION_NODE_NAME), + &ENV_VAR_NAME_NODE_NAME, &FieldPathEnvVar::Name, ) .with_value( - &EnvVarName::from_str_unsafe(CONFIG_OPTION_NETWORK_PUBLISH_HOST), + &ENV_VAR_NAME_NETWORK_PUBLISH_HOST, &fqdn, ) .with_value( - &EnvVarName::from_str_unsafe(CONFIG_OPTION_TRANSPORT_PUBLISH_HOST), + &ENV_VAR_NAME_TRANSPORT_PUBLISH_HOST, &fqdn, ) .with_value( - &EnvVarName::from_str_unsafe(CONFIG_OPTION_HTTP_PUBLISH_HOST), + &ENV_VAR_NAME_HTTP_PUBLISH_HOST, &fqdn, ) .with_value( - &EnvVarName::from_str_unsafe(CONFIG_OPTION_DISCOVERY_SEED_HOSTS), + &ENV_VAR_NAME_DISCOVERY_SEED_HOSTS, format!( "{}.{}.svc.{}", self.seed_nodes_service_name, self.cluster.namespace, self.cluster_domain_name ), ) .with_value( - &EnvVarName::from_str_unsafe(CONFIG_OPTION_NODE_ROLES), + &ENV_VAR_NAME_NODE_ROLES, Self::to_comma_separated_list( &self .role_group_config @@ -339,7 +353,7 @@ impl NodeConfig { if let Some(initial_cluster_manager_nodes) = self.initial_cluster_manager_nodes() { env_vars = env_vars.with_value( - &EnvVarName::from_str_unsafe(CONFIG_OPTION_INITIAL_CLUSTER_MANAGER_NODES), + &ENV_VAR_NAME_INITIAL_CLUSTER_MANAGER_NODES, initial_cluster_manager_nodes, ); } @@ -456,7 +470,7 @@ impl NodeConfig { /// Return content of the `OPENSEARCH_HOME` environment variable from envOverrides or default to `DEFAULT_OPENSEARCH_HOME` pub fn opensearch_home(&self) -> String { self.environment_variables() - .get(&EnvVarName::from_str_unsafe("OPENSEARCH_HOME")) + .get(&ENV_VAR_NAME_OPENSEARCH_HOME) .and_then(|env_var| env_var.value.clone()) .unwrap_or(DEFAULT_OPENSEARCH_HOME.to_owned()) } @@ -465,7 +479,7 @@ impl NodeConfig { pub fn opensearch_path_conf(&self) -> String { let opensearch_home = self.opensearch_home(); self.environment_variables() - .get(&EnvVarName::from_str_unsafe("OPENSEARCH_PATH_CONF")) + .get(&ENV_VAR_NAME_OPENSEARCH_PATH_CONF) .and_then(|env_var| env_var.value.clone()) .unwrap_or(format!("{opensearch_home}/config")) } @@ -675,6 +689,21 @@ mod tests { ); } + #[test] + fn test_constants() { + // Test that dereferencing the constants does not panic. + let _ = *ENV_VAR_NAME_DISCOVERY_SEED_HOSTS; + let _ = *ENV_VAR_NAME_HTTP_PUBLISH_HOST; + let _ = *ENV_VAR_NAME_INITIAL_CLUSTER_MANAGER_NODES; + let _ = *ENV_VAR_NAME_NETWORK_PUBLISH_HOST; + let _ = *ENV_VAR_NAME_NODE_NAME; + let _ = *ENV_VAR_NAME_NODE_ROLES; + let _ = *ENV_VAR_NAME_OPENSEARCH_HOME; + let _ = *ENV_VAR_NAME_OPENSEARCH_PATH_CONF; + let _ = *ENV_VAR_NAME_POD_NAME; + let _ = *ENV_VAR_NAME_TRANSPORT_PUBLISH_HOST; + } + #[test] pub fn test_super_admin_dn() { let node_config = node_config(TestConfig::default()); diff --git a/rust/operator-binary/src/controller/build/product_logging/config.rs b/rust/operator-binary/src/controller/build/product_logging/config.rs index 6ef44d83..d42634c4 100644 --- a/rust/operator-binary/src/controller/build/product_logging/config.rs +++ b/rust/operator-binary/src/controller/build/product_logging/config.rs @@ -1,8 +1,9 @@ //! OpenSearch specific log configuration -use std::{cmp, collections::BTreeMap}; +use std::{cmp, collections::BTreeMap, str::FromStr}; use stackable_operator::{ + constant, memory::{BinaryMultiple, MemoryQuantity}, product_logging::spec::{AppenderConfig, AutomaticContainerLogConfig, LogLevel, LoggerConfig}, v2::{ @@ -23,6 +24,8 @@ pub const MAX_OPENSEARCH_SERVER_LOG_FILES_SIZE: MemoryQuantity = MemoryQuantity unit: BinaryMultiple::Mebi, }; +constant!(ENV_VAR_NAME_OPENSEARCH_SERVER_LOG_FILE: EnvVarName = "OPENSEARCH_SERVER_LOG_FILE"); + /// Create a log4j2 configuration from the given automatic log configuration pub fn create_log4j2_config(config: &AutomaticContainerLogConfig) -> String { [ @@ -189,7 +192,7 @@ pub fn vector_config_file_content() -> String { /// [`crate::framework::product_logging::framework::vector_container`]. pub fn vector_config_file_extra_env_vars() -> EnvVarSet { EnvVarSet::new().with_value( - &EnvVarName::from_str_unsafe("OPENSEARCH_SERVER_LOG_FILE"), + &ENV_VAR_NAME_OPENSEARCH_SERVER_LOG_FILE, "opensearch_server.json", ) } @@ -200,7 +203,16 @@ mod tests { AppenderConfig, AutomaticContainerLogConfig, LogLevel, LoggerConfig, }; - use super::{create_log4j2_config, vector_config_file_extra_env_vars}; + use super::{ + ENV_VAR_NAME_OPENSEARCH_SERVER_LOG_FILE, create_log4j2_config, + vector_config_file_extra_env_vars, + }; + + #[test] + fn test_constants() { + // Test that dereferencing the constants does not panic. + let _ = *ENV_VAR_NAME_OPENSEARCH_SERVER_LOG_FILE; + } #[test] pub fn test_create_log4j2_config() { diff --git a/rust/operator-binary/src/controller/build/role_group_builder.rs b/rust/operator-binary/src/controller/build/role_group_builder.rs index 9f311752..a690f435 100644 --- a/rust/operator-binary/src/controller/build/role_group_builder.rs +++ b/rust/operator-binary/src/controller/build/role_group_builder.rs @@ -117,6 +117,10 @@ const OPENSEARCH_KEYSTORE_SECRETS_DIRECTORY: &str = "keystore-secrets"; constant!(OPENSEARCH_KEYSTORE_VOLUME_NAME: VolumeName = "keystore"); const OPENSEARCH_KEYSTORE_VOLUME_SIZE: &str = "1Mi"; +constant!(ENV_VAR_NAME_ADMIN_DN: EnvVarName = "ADMIN_DN"); +constant!(ENV_VAR_NAME_POD_NAME: EnvVarName = "POD_NAME"); +constant!(ENV_VAR_NAME_OPENSEARCH_PATH_CONF: EnvVarName = "OPENSEARCH_PATH_CONF"); + /// Depending on the security settings, the role group builder operates in one of these modes. #[derive(Clone, Debug)] pub enum RoleGroupSecurityMode { @@ -573,14 +577,8 @@ impl<'a> RoleGroupBuilder<'a> { }; let env_vars = EnvVarSet::new() - .with_value( - &EnvVarName::from_str_unsafe("ADMIN_DN"), - self.node_config.super_admin_dn(), - ) - .with_field_path( - &EnvVarName::from_str_unsafe("POD_NAME"), - &FieldPathEnvVar::Name, - ); + .with_value(&ENV_VAR_NAME_ADMIN_DN, self.node_config.super_admin_dn()) + .with_field_path(&ENV_VAR_NAME_POD_NAME, &FieldPathEnvVar::Name); let volume_mounts = vec![ VolumeMount { @@ -920,14 +918,8 @@ impl<'a> RoleGroupBuilder<'a> { volume_mounts.extend(self.security_config_volume_mounts(settings, false)); let mut env_vars = EnvVarSet::new() - .with_value( - &EnvVarName::from_str_unsafe("OPENSEARCH_PATH_CONF"), - opensearch_path_conf, - ) - .with_field_path( - &EnvVarName::from_str_unsafe("POD_NAME"), - &FieldPathEnvVar::Name, - ); + .with_value(&ENV_VAR_NAME_OPENSEARCH_PATH_CONF, opensearch_path_conf) + .with_field_path(&ENV_VAR_NAME_POD_NAME, &FieldPathEnvVar::Name); for file_type in settings { let managed_by_operator = @@ -973,7 +965,10 @@ impl<'a> RoleGroupBuilder<'a> { fn security_settings_file_type_managed_by_env_var( file_type: &ExtendedSecuritySettingsFileType, ) -> EnvVarName { - EnvVarName::from_str_unsafe(&format!("MANAGE_{}", file_type.id.to_uppercase())) + EnvVarName::from_str(&format!("MANAGE_{}", file_type.id.to_uppercase())).expect( + "The file type IDs are static strings which should produce valid environment variable \ + names.", + ) } /// Builds the config volumes for the [`PodTemplateSpec`] @@ -1474,8 +1469,9 @@ mod tests { use uuid::uuid; use super::{ - CONFIG_VOLUME_NAME, DATA_VOLUME_NAME, LOG_CONFIG_VOLUME_NAME, LOG_VOLUME_NAME, - ROLE_GROUP_LISTENER_VOLUME_NAME, RoleGroupBuilder, + CONFIG_VOLUME_NAME, DATA_VOLUME_NAME, ENV_VAR_NAME_ADMIN_DN, + ENV_VAR_NAME_OPENSEARCH_PATH_CONF, ENV_VAR_NAME_POD_NAME, LOG_CONFIG_VOLUME_NAME, + LOG_VOLUME_NAME, ROLE_GROUP_LISTENER_VOLUME_NAME, RoleGroupBuilder, }; use crate::{ controller::{ @@ -1492,17 +1488,20 @@ mod tests { #[test] fn test_constants() { - // Test that the functions do not panic - let _ = CONFIG_VOLUME_NAME; - let _ = LOG_CONFIG_VOLUME_NAME; - let _ = DATA_VOLUME_NAME; - let _ = ROLE_GROUP_LISTENER_VOLUME_NAME; - let _ = DISCOVERY_SERVICE_LISTENER_VOLUME_NAME; - let _ = TLS_SERVER_VOLUME_NAME; - let _ = TLS_SERVER_CA_VOLUME_NAME; - let _ = TLS_INTERNAL_VOLUME_NAME; - let _ = LOG_VOLUME_NAME; - let _ = OPENSEARCH_KEYSTORE_VOLUME_NAME; + // Test that dereferencing the constants does not panic. + let _ = *CONFIG_VOLUME_NAME; + let _ = *LOG_CONFIG_VOLUME_NAME; + let _ = *DATA_VOLUME_NAME; + let _ = *ROLE_GROUP_LISTENER_VOLUME_NAME; + let _ = *DISCOVERY_SERVICE_LISTENER_VOLUME_NAME; + let _ = *TLS_SERVER_VOLUME_NAME; + let _ = *TLS_SERVER_CA_VOLUME_NAME; + let _ = *TLS_INTERNAL_VOLUME_NAME; + let _ = *LOG_VOLUME_NAME; + let _ = *OPENSEARCH_KEYSTORE_VOLUME_NAME; + let _ = *ENV_VAR_NAME_ADMIN_DN; + let _ = *ENV_VAR_NAME_POD_NAME; + let _ = *ENV_VAR_NAME_OPENSEARCH_PATH_CONF; } #[test] diff --git a/rust/operator-binary/src/controller/validate.rs b/rust/operator-binary/src/controller/validate.rs index 9ee7b7c8..22e6b9e0 100644 --- a/rust/operator-binary/src/controller/validate.rs +++ b/rust/operator-binary/src/controller/validate.rs @@ -81,7 +81,7 @@ pub enum Error { #[snafu(display("failed to parse environment variable"))] ParseEnvironmentVariable { - source: stackable_operator::v2::builder::pod::container::Error, + source: stackable_operator::v2::macros::attributed_string_type::Error, }, #[snafu(display("failed to parse the hostname of the Listener status"))] From 4dc39703fa32ac2de173debc6ed7a59d87fe1918 Mon Sep 17 00:00:00 2001 From: Siegfried Weber Date: Fri, 19 Jun 2026 11:15:58 +0200 Subject: [PATCH 03/10] Move prometheus_labels and prometheus_annotations to the framework --- Cargo.lock | 18 +++---- Cargo.nix | 36 ++++++------- crate-hashes.json | 18 +++---- .../controller/build/role_group_builder.rs | 51 ++++--------------- 4 files changed, 47 insertions(+), 76 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 10d33625..5ae82019 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1532,7 +1532,7 @@ dependencies = [ [[package]] name = "k8s-version" version = "0.1.3" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#365ccb529aa1e6d30faa7c104a169c4f5329d9c2" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#a728c7f0504f24293651c3eeec0d8b15c7fb9ccd" dependencies = [ "darling", "regex", @@ -2923,7 +2923,7 @@ checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "stackable-certs" version = "0.4.0" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#365ccb529aa1e6d30faa7c104a169c4f5329d9c2" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#a728c7f0504f24293651c3eeec0d8b15c7fb9ccd" dependencies = [ "const-oid", "ecdsa", @@ -2969,7 +2969,7 @@ dependencies = [ [[package]] name = "stackable-operator" version = "0.111.1" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#365ccb529aa1e6d30faa7c104a169c4f5329d9c2" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#a728c7f0504f24293651c3eeec0d8b15c7fb9ccd" dependencies = [ "base64", "clap", @@ -3014,7 +3014,7 @@ dependencies = [ [[package]] name = "stackable-operator-derive" version = "0.3.1" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#365ccb529aa1e6d30faa7c104a169c4f5329d9c2" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#a728c7f0504f24293651c3eeec0d8b15c7fb9ccd" dependencies = [ "darling", "proc-macro2", @@ -3025,7 +3025,7 @@ dependencies = [ [[package]] name = "stackable-shared" version = "0.1.1" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#365ccb529aa1e6d30faa7c104a169c4f5329d9c2" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#a728c7f0504f24293651c3eeec0d8b15c7fb9ccd" dependencies = [ "jiff", "k8s-openapi", @@ -3042,7 +3042,7 @@ dependencies = [ [[package]] name = "stackable-telemetry" version = "0.6.4" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#365ccb529aa1e6d30faa7c104a169c4f5329d9c2" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#a728c7f0504f24293651c3eeec0d8b15c7fb9ccd" dependencies = [ "axum", "clap", @@ -3066,7 +3066,7 @@ dependencies = [ [[package]] name = "stackable-versioned" version = "0.10.0" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#365ccb529aa1e6d30faa7c104a169c4f5329d9c2" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#a728c7f0504f24293651c3eeec0d8b15c7fb9ccd" dependencies = [ "kube", "schemars", @@ -3080,7 +3080,7 @@ dependencies = [ [[package]] name = "stackable-versioned-macros" version = "0.10.0" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#365ccb529aa1e6d30faa7c104a169c4f5329d9c2" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#a728c7f0504f24293651c3eeec0d8b15c7fb9ccd" dependencies = [ "convert_case", "convert_case_extras", @@ -3098,7 +3098,7 @@ dependencies = [ [[package]] name = "stackable-webhook" version = "0.9.1" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#365ccb529aa1e6d30faa7c104a169c4f5329d9c2" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#a728c7f0504f24293651c3eeec0d8b15c7fb9ccd" dependencies = [ "arc-swap", "async-trait", diff --git a/Cargo.nix b/Cargo.nix index 81e93247..85f82049 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -4884,8 +4884,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech//operator-rs.git"; - rev = "365ccb529aa1e6d30faa7c104a169c4f5329d9c2"; - sha256 = "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj"; + rev = "a728c7f0504f24293651c3eeec0d8b15c7fb9ccd"; + sha256 = "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i"; }; libName = "k8s_version"; authors = [ @@ -9604,8 +9604,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech//operator-rs.git"; - rev = "365ccb529aa1e6d30faa7c104a169c4f5329d9c2"; - sha256 = "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj"; + rev = "a728c7f0504f24293651c3eeec0d8b15c7fb9ccd"; + sha256 = "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i"; }; libName = "stackable_certs"; authors = [ @@ -9809,8 +9809,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech//operator-rs.git"; - rev = "365ccb529aa1e6d30faa7c104a169c4f5329d9c2"; - sha256 = "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj"; + rev = "a728c7f0504f24293651c3eeec0d8b15c7fb9ccd"; + sha256 = "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i"; }; libName = "stackable_operator"; authors = [ @@ -10008,8 +10008,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech//operator-rs.git"; - rev = "365ccb529aa1e6d30faa7c104a169c4f5329d9c2"; - sha256 = "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj"; + rev = "a728c7f0504f24293651c3eeec0d8b15c7fb9ccd"; + sha256 = "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i"; }; procMacro = true; libName = "stackable_operator_derive"; @@ -10043,8 +10043,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech//operator-rs.git"; - rev = "365ccb529aa1e6d30faa7c104a169c4f5329d9c2"; - sha256 = "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj"; + rev = "a728c7f0504f24293651c3eeec0d8b15c7fb9ccd"; + sha256 = "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i"; }; libName = "stackable_shared"; authors = [ @@ -10124,8 +10124,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech//operator-rs.git"; - rev = "365ccb529aa1e6d30faa7c104a169c4f5329d9c2"; - sha256 = "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj"; + rev = "a728c7f0504f24293651c3eeec0d8b15c7fb9ccd"; + sha256 = "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i"; }; libName = "stackable_telemetry"; authors = [ @@ -10234,8 +10234,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech//operator-rs.git"; - rev = "365ccb529aa1e6d30faa7c104a169c4f5329d9c2"; - sha256 = "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj"; + rev = "a728c7f0504f24293651c3eeec0d8b15c7fb9ccd"; + sha256 = "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i"; }; libName = "stackable_versioned"; authors = [ @@ -10284,8 +10284,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech//operator-rs.git"; - rev = "365ccb529aa1e6d30faa7c104a169c4f5329d9c2"; - sha256 = "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj"; + rev = "a728c7f0504f24293651c3eeec0d8b15c7fb9ccd"; + sha256 = "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i"; }; procMacro = true; libName = "stackable_versioned_macros"; @@ -10352,8 +10352,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech//operator-rs.git"; - rev = "365ccb529aa1e6d30faa7c104a169c4f5329d9c2"; - sha256 = "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj"; + rev = "a728c7f0504f24293651c3eeec0d8b15c7fb9ccd"; + sha256 = "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i"; }; libName = "stackable_webhook"; authors = [ diff --git a/crate-hashes.json b/crate-hashes.json index 1e9f53e9..9a0b683e 100644 --- a/crate-hashes.json +++ b/crate-hashes.json @@ -1,12 +1,12 @@ { - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#k8s-version@0.1.3": "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj", - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-certs@0.4.0": "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj", - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-operator-derive@0.3.1": "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj", - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-operator@0.111.1": "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj", - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-shared@0.1.1": "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj", - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-telemetry@0.6.4": "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj", - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-versioned-macros@0.10.0": "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj", - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-versioned@0.10.0": "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj", - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-webhook@0.9.1": "0s7g90smh103ngq3p1j8svjzh4ri4dk8smpwcn8axfayzangjddj", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#k8s-version@0.1.3": "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-certs@0.4.0": "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-operator-derive@0.3.1": "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-operator@0.111.1": "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-shared@0.1.1": "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-telemetry@0.6.4": "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-versioned-macros@0.10.0": "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-versioned@0.10.0": "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i", + "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-webhook@0.9.1": "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i", "git+https://github.com/stackabletech/product-config.git?tag=0.8.0#product-config@0.8.0": "1dz70kapm2wdqcr7ndyjji0lhsl98bsq95gnb2lw487wf6yr7987" } \ No newline at end of file diff --git a/rust/operator-binary/src/controller/build/role_group_builder.rs b/rust/operator-binary/src/controller/build/role_group_builder.rs index a690f435..9673a04f 100644 --- a/rust/operator-binary/src/controller/build/role_group_builder.rs +++ b/rust/operator-binary/src/controller/build/role_group_builder.rs @@ -48,6 +48,7 @@ use stackable_operator::{ container::{EnvVarName, EnvVarSet, new_container_builder}, volume::{ListenerReference, listener_operator_volume_source_builder_build_pvc}, }, + service::{Scheme, Scraping, prometheus_annotations, prometheus_labels}, statefulset::{ restarter_ignore_configmap_annotations, restarter_ignore_secret_annotations, }, @@ -1300,9 +1301,16 @@ impl<'a> RoleGroupBuilder<'a> { pub fn build_headless_service(&self) -> Service { let metadata = self .common_metadata(self.resource_names.headless_service_name()) - .with_labels(Self::prometheus_labels()) - .with_annotations(Self::prometheus_annotations( - self.security_mode.tls_server_secret_class().is_some(), + .with_labels(prometheus_labels(&Scraping::Enabled)) + .with_annotations(prometheus_annotations( + &Scraping::Enabled, + if self.security_mode.tls_server_secret_class().is_some() { + &Scheme::Https + } else { + &Scheme::Http + }, + "/_prometheus/metrics", + &HTTP_PORT, )) .build(); @@ -1336,36 +1344,6 @@ impl<'a> RoleGroupBuilder<'a> { } } - /// Common labels for Prometheus - fn prometheus_labels() -> Labels { - Labels::try_from([("prometheus.io/scrape", "true")]).expect("should be a valid label") - } - - /// Common annotations for Prometheus - /// - /// These annotations can be used in a ServiceMonitor. - /// - /// see also - fn prometheus_annotations(tls_on_http_port_enabled: bool) -> Annotations { - Annotations::try_from([ - ( - "prometheus.io/path".to_owned(), - "/_prometheus/metrics".to_owned(), - ), - ("prometheus.io/port".to_owned(), HTTP_PORT.to_string()), - ( - "prometheus.io/scheme".to_owned(), - if tls_on_http_port_enabled { - "https".to_owned() - } else { - "http".to_owned() - }, - ), - ("prometheus.io/scrape".to_owned(), "true".to_owned()), - ]) - .expect("should be valid annotations") - } - /// Builds the [`listener::v1alpha1::Listener`] for the role group /// /// The Listener exposes only the HTTP port. @@ -3416,11 +3394,4 @@ mod tests { RoleGroupBuilder::build_node_role_label(&node_role); } } - - #[test] - fn test_prometheus_annotations() { - // Test that the function does not panic on all possible inputs - RoleGroupBuilder::prometheus_annotations(false); - RoleGroupBuilder::prometheus_annotations(true); - } } From 53774596fec52d217b1df429aaa919fea0a419e7 Mon Sep 17 00:00:00 2001 From: Siegfried Weber Date: Fri, 19 Jun 2026 11:39:56 +0200 Subject: [PATCH 04/10] Fix comment --- .../src/controller/build/product_logging/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/operator-binary/src/controller/build/product_logging/config.rs b/rust/operator-binary/src/controller/build/product_logging/config.rs index d42634c4..6fcb8707 100644 --- a/rust/operator-binary/src/controller/build/product_logging/config.rs +++ b/rust/operator-binary/src/controller/build/product_logging/config.rs @@ -189,7 +189,7 @@ pub fn vector_config_file_content() -> String { /// Returns the OpenSearch specific environment variables used in the Vector configuration file /// /// The common environment variables are already set in -/// [`crate::framework::product_logging::framework::vector_container`]. +/// [`stackable_operator::v2::product_logging::framework::vector_container`]. pub fn vector_config_file_extra_env_vars() -> EnvVarSet { EnvVarSet::new().with_value( &ENV_VAR_NAME_OPENSEARCH_SERVER_LOG_FILE, From 11169f1cefcca9939ae5aa365c137fd181d48f42 Mon Sep 17 00:00:00 2001 From: Siegfried Weber Date: Fri, 19 Jun 2026 12:13:44 +0200 Subject: [PATCH 05/10] Upgrade all dependencies --- Cargo.lock | 357 +++++++++++----------- Cargo.nix | 511 ++++++++++++++------------------ Cargo.toml | 11 +- rust/operator-binary/Cargo.toml | 3 +- 4 files changed, 396 insertions(+), 486 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5ae82019..fb633c4b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -141,7 +141,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -152,7 +152,7 @@ checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -163,9 +163,9 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" [[package]] name = "axum" @@ -265,9 +265,9 @@ checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" [[package]] name = "bitflags" -version = "2.11.1" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" +checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8" [[package]] name = "block-buffer" @@ -280,9 +280,9 @@ dependencies = [ [[package]] name = "built" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4ad8f11f288f48ca24471bbd51ac257aaeaaa07adae295591266b792902ae64" +checksum = "5c0e531d93d39c34eef561e929e8a7f86d77a5af08aac4f6d6e39976c51858e9" dependencies = [ "chrono", "git2", @@ -290,21 +290,21 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.20.2" +version = "3.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" [[package]] name = "bytes" -version = "1.11.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" +checksum = "8ae3f5d315924270530207e2a68396c3cc547f6dca3fbdca317cfb1a51edb593" [[package]] name = "cc" -version = "1.2.61" +version = "1.2.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16d90359e986641506914ba71350897565610e87ce0ad9e6f28569db3dd5c6d" +checksum = "dad887fd958be91b5098c0248def011f4523ab786cd411be668777e55063501f" dependencies = [ "find-msvc-tools", "jobserver", @@ -320,9 +320,9 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "chrono" -version = "0.4.44" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" dependencies = [ "iana-time-zone", "num-traits", @@ -360,7 +360,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -520,7 +520,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -531,7 +531,7 @@ checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" dependencies = [ "darling_core", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -542,7 +542,7 @@ checksum = "780eb241654bf097afb00fc5f054a09b687dad862e485fdcf8399bb056565370" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -566,7 +566,7 @@ checksum = "8034092389675178f570469e6c3b0465d3d30b4505c294a6550db47f3c17ad18" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -574,9 +574,6 @@ name = "deranged" version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" -dependencies = [ - "powerfmt", -] [[package]] name = "derive_more" @@ -596,7 +593,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -619,13 +616,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -677,14 +674,14 @@ dependencies = [ "enum-ordinalize", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] name = "either" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" [[package]] name = "elliptic-curve" @@ -741,7 +738,7 @@ checksum = "8ca9601fb2d62598ee17836250842873a413586e5d7ed88b356e38ddbb0ec631" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -913,7 +910,7 @@ checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -930,9 +927,9 @@ checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" [[package]] name = "futures-timer" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" +checksum = "af43fadb8a98512d547e37b4e92e0ced13e205c061b87b4623eff01d918d6968" [[package]] name = "futures-util" @@ -989,15 +986,14 @@ dependencies = [ [[package]] name = "git2" -version = "0.20.4" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b88256088d75a56f8ecfa070513a775dd9107f6530ef14919dac831af9cfe2b" +checksum = "ddddbf932745a6be37109b6112d3ee09696106f848449069d3a57bba937ab82e" dependencies = [ "bitflags", "libc", "libgit2-sys", "log", - "url", ] [[package]] @@ -1031,9 +1027,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "171fefbc92fe4a4de27e0698d6a5b392d6a0e333506bc49133760b3bcf948733" +checksum = "6cb093c84e8bd9b188d4c4a8cb6579fc016968d14c99882163cd3ff402a4f155" dependencies = [ "atomic-waker", "bytes", @@ -1061,9 +1057,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.17.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" [[package]] name = "heck" @@ -1093,9 +1089,9 @@ dependencies = [ [[package]] name = "http" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" dependencies = [ "bytes", "itoa", @@ -1144,9 +1140,9 @@ checksum = "135b12329e5e3ce057a9f972339ea52bc954fe1e9358ef27f95e89716fbc5424" [[package]] name = "hyper" -version = "1.9.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6299f016b246a94207e63da54dbe807655bf9e00044f73ded42c3ac5305fbcca" +checksum = "55281c53a1894c864990125767da440a4e630446785086f52523b20033b74498" dependencies = [ "atomic-waker", "bytes", @@ -1357,7 +1353,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" dependencies = [ "equivalent", - "hashbrown 0.17.0", + "hashbrown 0.17.1", ] [[package]] @@ -1375,16 +1371,6 @@ version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" -[[package]] -name = "iri-string" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25e659a4bb38e810ebc252e53b5814ff908a8c58c2a9ce2fae1bbec24cbf4e20" -dependencies = [ - "memchr", - "serde", -] - [[package]] name = "is_terminal_polyfill" version = "1.70.2" @@ -1419,9 +1405,9 @@ dependencies = [ [[package]] name = "jiff" -version = "0.2.24" +version = "0.2.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00b5dbd620d61dfdcb6007c9c1f6054ebd75319f163d886a9055cec1155073d" +checksum = "4603d3033e49e2b0e31229fcab20a5d40089c607d975cd9c80551dc69eed9102" dependencies = [ "jiff-static", "jiff-tzdb-platform", @@ -1429,18 +1415,18 @@ dependencies = [ "portable-atomic", "portable-atomic-util", "serde_core", - "windows-sys 0.61.2", + "windows-link", ] [[package]] name = "jiff-static" -version = "0.2.24" +version = "0.2.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e000de030ff8022ea1da3f466fbb0f3a809f5e51ed31f6dd931c35181ad8e6d7" +checksum = "782d32378dddf207193ac91cefb848ad41abb58195c95168e1291227a0832b47" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -1470,13 +1456,12 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.97" +version = "0.3.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1840c94c045fbcf8ba2812c95db44499f7c64910a912551aaaa541decebcacf" +checksum = "03d04c30968dffe80775bd4d7fb676131cd04a1fb46d2686dbffbaec2d9dfd31" dependencies = [ "cfg-if", "futures-util", - "once_cell", "wasm-bindgen", ] @@ -1632,7 +1617,7 @@ dependencies = [ "quote", "serde", "serde_json", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -1679,9 +1664,9 @@ checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" [[package]] name = "libgit2-sys" -version = "0.18.3+1.9.2" +version = "0.18.5+1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9b3acc4b91781bb0b3386669d325163746af5f6e4f73e6d2d630e09a35f3487" +checksum = "005d6ae6eac1912906073e069f7db60b1fa98e052a68227824afe3e3a1c59ca2" dependencies = [ "cc", "libc", @@ -1697,9 +1682,9 @@ checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" [[package]] name = "libz-sys" -version = "1.1.28" +version = "1.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc3a226e576f50782b3305c5ccf458698f92798987f551c6a02efe8276721e22" +checksum = "85bc9657773828b90eeb625adff10eeac83cc21bbfd8e23a03eaa8a33c9e28d9" dependencies = [ "cc", "libc", @@ -1724,9 +1709,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.29" +version = "0.4.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" +checksum = "953f07c43838f8e6f9758cab68bf5bed85465e7587ebe0b823f1bcd81978ad3a" [[package]] name = "matchers" @@ -1745,9 +1730,9 @@ checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" [[package]] name = "memchr" -version = "2.8.0" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" +checksum = "88904434abc2901f197fe8cc55f0445e7ded921dba5911dad2e2b39b48e663c4" [[package]] name = "mime" @@ -1767,9 +1752,9 @@ dependencies = [ [[package]] name = "mio" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" +checksum = "02bd0af71c67b473010cbbc60715ee815645a4dc942899111f494b4b737d6fda" dependencies = [ "libc", "wasi", @@ -1803,9 +1788,9 @@ dependencies = [ [[package]] name = "num-conv" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6673768db2d862beb9b39a78fdcb1a69439615d5794a1be50caa9bc92c81967" +checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" [[package]] name = "num-integer" @@ -2055,7 +2040,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -2070,22 +2055,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.12" +version = "1.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf0d9e68100b3a7989b4901972f265cd542e560a3a8a724e1e20322f4d06ce9" +checksum = "2466b2336ed02bcdca6b294417127b90ec92038d1d5c4fbeac971a922e0e0924" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.12" +version = "1.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a990e22f43e84855daf260dded30524ef4a9021cc7541c26540500a50b624389" +checksum = "c96395f0a926bc13b1c17622aaddda1ecb55d49c8f1bf9777e4d877800a43f8b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -2215,9 +2200,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.14.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2ea70524a2f82d518bce41317d0fae74151505651af45faf1ffbd6fd33f0568" +checksum = "528ac67416ff8646872a3c02cad9cc4ee5dc9f9540c9b10771855c95cb2e5ae1" dependencies = [ "bytes", "prost-derive", @@ -2225,22 +2210,22 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.14.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27c6023962132f4b30eb4c172c91ce92d933da334c59c23cddee82358ddafb0b" +checksum = "b570b25f7617e43d59005d0990ccb79e950a423952cea19671b7a876da390adf" dependencies = [ "anyhow", "itertools", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] name = "prost-types" -version = "0.14.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8991c4cbdb8bc5b11f0b074ffe286c30e523de90fee5ba8132f1399f23cb3dd7" +checksum = "f94967dc7688f3054c7fac87473ffae4cc4c3904800e2d9f5b857246d8963b0a" dependencies = [ "prost", ] @@ -2344,14 +2329,14 @@ checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] name = "regex" -version = "1.12.3" +version = "1.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +checksum = "f1292b7759ae1cb9ec195452d1390a074f0cd8541ab7a5a8c31cd6db45d4a6ba" dependencies = [ "aho-corasick", "memchr", @@ -2372,9 +2357,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" [[package]] name = "relative-path" @@ -2483,7 +2468,7 @@ dependencies = [ "regex", "relative-path", "rustc_version", - "syn 2.0.117", + "syn 2.0.118", "unicode-ident", ] @@ -2513,9 +2498,9 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" +checksum = "dab5152771c58876a2146916e53e35057e1a4dfa2b9df0f0305b07f611fdea4d" dependencies = [ "openssl-probe", "rustls-pki-types", @@ -2587,7 +2572,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -2685,7 +2670,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -2696,14 +2681,14 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] name = "serde_json" -version = "1.0.149" +version = "1.0.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" dependencies = [ "itoa", "memchr", @@ -2781,9 +2766,9 @@ dependencies = [ [[package]] name = "shlex" -version = "1.3.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" [[package]] name = "signal-hook-registry" @@ -2819,9 +2804,9 @@ checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" [[package]] name = "smallvec" -version = "1.15.1" +version = "1.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" [[package]] name = "snafu" @@ -2873,7 +2858,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -2885,14 +2870,14 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] name = "socket2" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" +checksum = "52d1cfed4120b4d927bf7c0f86d2087a4a7d6027c906d9f9d525a80573b9be51" dependencies = [ "libc", "windows-sys 0.61.2", @@ -2951,7 +2936,6 @@ dependencies = [ "built", "clap", "futures 0.3.32", - "json-patch", "pretty_assertions", "regex", "rstest", @@ -3019,7 +3003,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -3092,7 +3076,7 @@ dependencies = [ "kube", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -3151,7 +3135,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -3179,9 +3163,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.117" +version = "2.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422" dependencies = [ "proc-macro2", "quote", @@ -3205,7 +3189,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -3234,7 +3218,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -3245,7 +3229,7 @@ checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -3259,12 +3243,11 @@ dependencies = [ [[package]] name = "time" -version = "0.3.47" +version = "0.3.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" +checksum = "711a53c2d47bbd818258c498c8dbfe186a2526c631495cfe7e078567f86b8469" dependencies = [ "deranged", - "itoa", "num-conv", "powerfmt", "serde_core", @@ -3274,15 +3257,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" +checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109" [[package]] name = "time-macros" -version = "0.2.27" +version = "0.2.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" +checksum = "71c652a3727a9cbb9a02f707f530b618ce00d0ccd762009c8c23bd191df3c17d" dependencies = [ "num-conv", "time-core", @@ -3316,14 +3299,14 @@ checksum = "2d2e76690929402faae40aebdda620a2c0e25dd6d3b9afe48867dfd95991f4bd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] name = "tokio" -version = "1.52.2" +version = "1.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "110a78583f19d5cdb2c5ccf321d1290344e71313c6c37d43520d386027d18386" +checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe" dependencies = [ "bytes", "libc", @@ -3344,7 +3327,7 @@ checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -3393,9 +3376,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.25.11+spec-1.1.0" +version = "0.25.12+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b59c4d22ed448339746c59b905d24568fcbb3ab65a500494f7b8c3e97739f2b" +checksum = "d2153edc6955a6c354fad8f5efd38b6a8769bdccf9fe50f8e1329f81b0baa5d7" dependencies = [ "indexmap", "toml_datetime", @@ -3414,9 +3397,9 @@ dependencies = [ [[package]] name = "tonic" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fec7c61a0695dc1887c1b53952990f3ad2e3a31453e1f49f10e75424943a93ec" +checksum = "ac2a5518c70fa84342385732db33fb3f44bc4cc748936eb5833d2df34d6445ef" dependencies = [ "async-trait", "base64", @@ -3441,9 +3424,9 @@ dependencies = [ [[package]] name = "tonic-prost" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55376a0bbaa4975a3f10d009ad763d8f4108f067c7c2e74f3001fb49778d309" +checksum = "50849f68853be452acf590cde0b146665b8d507b3b8af17261df47e02c209ea0" dependencies = [ "bytes", "prost", @@ -3452,9 +3435,9 @@ dependencies = [ [[package]] name = "tonic-types" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a875a902255423d34c1f20838ab374126db8eb41625b7947a1d54113b0b7399" +checksum = "73ab1b02061f83d519bba3caa167f88f261ef05720ab8ebc954ade70de3348e8" dependencies = [ "prost", "prost-types", @@ -3482,9 +3465,9 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.6.8" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" +checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" dependencies = [ "base64", "bitflags", @@ -3492,13 +3475,13 @@ dependencies = [ "futures-util", "http", "http-body", - "iri-string", "mime", "pin-project-lite", "tower", "tower-layer", "tower-service", "tracing", + "url", ] [[package]] @@ -3546,7 +3529,7 @@ checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -3625,9 +3608,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" -version = "1.20.0" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ce102ab67701b8526c123c1bab5cbe42d7040ccfd0f64af1a385808d2f43de" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" [[package]] name = "ucd-trie" @@ -3643,9 +3626,9 @@ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] name = "unicode-segmentation" -version = "1.13.2" +version = "1.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c" +checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" [[package]] name = "unicode-xid" @@ -3692,9 +3675,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.23.1" +version = "1.23.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd74a9687298c6858e9b88ec8935ec45d22e8fd5e6394fa1bd4e99a87789c76" +checksum = "144d6b123cef80b301b8f72a9e2ca4370ddec21950d0a103dd22c437006d2db7" dependencies = [ "js-sys", "wasm-bindgen", @@ -3735,18 +3718,18 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasip2" -version = "1.0.3+wasi-0.2.9" +version = "1.0.4+wasi-0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6" +checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" dependencies = [ "wit-bindgen", ] [[package]] name = "wasm-bindgen" -version = "0.2.120" +version = "0.2.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df52b6d9b87e0c74c9edfa1eb2d9bf85e5d63515474513aa50fa181b3c4f5db1" +checksum = "8ddb3f79143bced6de84270411622a2699cee572fc0875aeaf1e7867cf9fca1a" dependencies = [ "cfg-if", "once_cell", @@ -3757,9 +3740,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.70" +version = "0.4.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af934872acec734c2d80e6617bbb5ff4f12b052dd8e6332b0817bce889516084" +checksum = "503b14d284f2c8dac03b819967e155ea753f573586193b2b2c95990cb5d69280" dependencies = [ "js-sys", "wasm-bindgen", @@ -3767,9 +3750,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.120" +version = "0.2.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b1041f495fb322e64aca85f5756b2172e35cd459376e67f2a6c9dffcedb103" +checksum = "4e21a184b13fb19e157296e2c46056aec9092264fab83e4ba59e68c61b323c3d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3777,31 +3760,31 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.120" +version = "0.2.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dcd0ff20416988a18ac686d4d4d0f6aae9ebf08a389ff5d29012b05af2a1b41" +checksum = "fecefd9c35bd935a20fc3fc344b5f29138961e4f47fb03297d88f2587afb5ebd" dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.120" +version = "0.2.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49757b3c82ebf16c57d69365a142940b384176c24df52a087fb748e2085359ea" +checksum = "23939e44bb9a5d7576fa2b563dc2e136628f1224e88a8deed09e04858b77871f" dependencies = [ "unicode-ident", ] [[package]] name = "web-sys" -version = "0.3.97" +version = "0.3.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eadbac71025cd7b0834f20d1fe8472e8495821b4e9801eb0a60bd1f19827602" +checksum = "a6430a72df5eb332242960fe84b3002a241163998241eb596d4f739b9757061d" dependencies = [ "js-sys", "wasm-bindgen", @@ -3838,7 +3821,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -3849,7 +3832,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -3960,9 +3943,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ee1708bef14716a11bae175f579062d4554d95be2c6829f518df847b7b3fdd0" +checksum = "0592e1c9d151f854e6fd382574c3a0855250e1d9b2f99d9281c6e6391af352f1" dependencies = [ "memchr", ] @@ -4007,9 +3990,9 @@ checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" [[package]] name = "yoke" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" +checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" dependencies = [ "stable_deref_trait", "yoke-derive", @@ -4024,35 +4007,35 @@ checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", "synstructure", ] [[package]] name = "zerocopy" -version = "0.8.48" +version = "0.8.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" +checksum = "ce1022995ff5ff5d841ad7d994facc23098cd40152f2c1d11cd607c6f530653f" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.48" +version = "0.8.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" +checksum = "1ae7f38b72ec2a254e2b87ef277cf2cd4fb97cbebf944faa6f33354da0867930" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] name = "zerofrom" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69faa1f2a1ea75661980b013019ed6687ed0e83d069bc1114e2cc74c6c04c4df" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" dependencies = [ "zerofrom-derive", ] @@ -4065,28 +4048,28 @@ checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", "synstructure", ] [[package]] name = "zeroize" -version = "1.8.2" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" +checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e" dependencies = [ "zeroize_derive", ] [[package]] name = "zeroize_derive" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85a5b4158499876c763cb03bc4e49185d3cccbabb15b33c627f7884f43db852e" +checksum = "3c50655cbb0fe3fc43170059e702f1ce5e19b84cec58dc87b037a09935c2f328" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -4119,7 +4102,7 @@ checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] diff --git a/Cargo.nix b/Cargo.nix index 85f82049..8cf74806 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -439,7 +439,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; features = [ "full" "visit-mut" ]; } ]; @@ -466,7 +466,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; usesDefaultFeatures = false; features = [ "clone-impls" "full" "parsing" "printing" "proc-macro" "visit-mut" ]; } @@ -489,9 +489,9 @@ rec { }; "autocfg" = rec { crateName = "autocfg"; - version = "1.5.0"; + version = "1.5.1"; edition = "2015"; - sha256 = "1s77f98id9l4af4alklmzq46f21c980v13z2r1pcxx6bqgw0d1n0"; + sha256 = "0lqasy5i30flcgih1b50kvsk6z32g09r1q4ql7q81pj6228jy0zj"; authors = [ "Josh Stone " ]; @@ -866,9 +866,9 @@ rec { }; "bitflags" = rec { crateName = "bitflags"; - version = "2.11.1"; + version = "2.13.0"; edition = "2021"; - sha256 = "1cvqijg3rvwgis20a66vfdxannjsxfy5fgjqkaq3l13gyfcj4lf4"; + sha256 = "1y239gpvl061rfvav7jds8mjs42kmwi39is7yx5d1qw3hvp8nf5l"; authors = [ "The Rust Project Developers" ]; @@ -898,9 +898,9 @@ rec { }; "built" = rec { crateName = "built"; - version = "0.8.0"; - edition = "2021"; - sha256 = "0r5f08lpjsr6j5ajkbmd0ymfmajpq8ddbfvi8ji8rx48y88qzbgl"; + version = "0.8.1"; + edition = "2024"; + sha256 = "1saq332pd6g3svvc9ah8myjpfvgqlzl2ksb1ypp3976kjcfm63jw"; authors = [ "Lukas Lueg " ]; @@ -924,15 +924,16 @@ rec { "chrono" = [ "dep:chrono" ]; "dependency-tree" = [ "cargo-lock/dependency-tree" ]; "git2" = [ "dep:git2" ]; + "gix" = [ "dep:gix" ]; "semver" = [ "dep:semver" ]; }; resolvedDefaultFeatures = [ "chrono" "git2" ]; }; "bumpalo" = rec { crateName = "bumpalo"; - version = "3.20.2"; + version = "3.20.3"; edition = "2021"; - sha256 = "1jrgxlff76k9glam0akhwpil2fr1w32gbjdf5hpipc7ld2c7h82x"; + sha256 = "0jc6va3nwcqikm7chnpdv1s87my3gs2j7g1sc7g3k91brg3arxbj"; authors = [ "Nick Fitzgerald " ]; @@ -945,9 +946,9 @@ rec { }; "bytes" = rec { crateName = "bytes"; - version = "1.11.1"; + version = "1.12.0"; edition = "2021"; - sha256 = "0czwlhbq8z29wq0ia87yass2mzy1y0jcasjb8ghriiybnwrqfx0y"; + sha256 = "14xmxm8imyvw675bsgyadmzm9k63js1sdqh7099p0hlj2p9zbqwa"; authors = [ "Carl Lerche " "Sean McArthur " @@ -961,9 +962,9 @@ rec { }; "cc" = rec { crateName = "cc"; - version = "1.2.61"; + version = "1.2.64"; edition = "2018"; - sha256 = "0vawvnrrsmi8dygavq3wx085cmlp10sp3fhld5842rlqkqsr0vfi"; + sha256 = "07shcd8faxw7csz13m3cg2mj6i8z07pqs960k181pscbjpyqgn6s"; authors = [ "Alex Crichton " ]; @@ -1011,9 +1012,9 @@ rec { }; "chrono" = rec { crateName = "chrono"; - version = "0.4.44"; + version = "0.4.45"; edition = "2021"; - sha256 = "1c64mk9a235271j5g3v4zrzqqmd43vp9vki7vqfllpqf5rd0fwy6"; + sha256 = "09rkcgk6is2sdhqs9142zv8xqnj8ryx8m9hknllqwyv9wxi9x9qs"; dependencies = [ { name = "iana-time-zone"; @@ -1160,7 +1161,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; features = [ "full" ]; } ]; @@ -1591,7 +1592,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; features = [ "full" "extra-traits" ]; } ]; @@ -1622,7 +1623,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; } ]; @@ -1648,7 +1649,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; features = [ "full" "visit-mut" ]; } ]; @@ -1725,7 +1726,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; features = [ "extra-traits" ]; } ]; @@ -1739,14 +1740,6 @@ rec { authors = [ "Jacob Pratt " ]; - dependencies = [ - { - name = "powerfmt"; - packageId = "powerfmt"; - optional = true; - usesDefaultFeatures = false; - } - ]; features = { "macros" = [ "dep:deranged-macros" ]; "num" = [ "dep:num-traits" ]; @@ -1758,7 +1751,7 @@ rec { "rand09" = [ "dep:rand09" ]; "serde" = [ "dep:serde_core" ]; }; - resolvedDefaultFeatures = [ "default" "powerfmt" ]; + resolvedDefaultFeatures = [ "default" ]; }; "derive_more" = rec { crateName = "derive_more"; @@ -1827,7 +1820,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; } ]; buildDependencies = [ @@ -1916,9 +1909,9 @@ rec { }; "displaydoc" = rec { crateName = "displaydoc"; - version = "0.2.5"; + version = "0.2.6"; edition = "2021"; - sha256 = "1q0alair462j21iiqwrr21iabkfnb13d6x5w95lkdg21q2xrqdlp"; + sha256 = "0kyxwfbdmagd8afzb2pzja7wj8dhah7smxdsgw00iq8pa2jhmiqs"; procMacro = true; authors = [ "Jane Lusby " @@ -1934,7 +1927,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; } ]; features = { @@ -2100,13 +2093,13 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; } ]; devDependencies = [ { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; features = [ "full" ]; } ]; @@ -2118,12 +2111,9 @@ rec { }; "either" = rec { crateName = "either"; - version = "1.15.0"; + version = "1.16.0"; edition = "2021"; - sha256 = "069p1fknsmzn9llaizh77kip0pqmcwpdsykv2x30xpjyija5gis8"; - authors = [ - "bluss" - ]; + sha256 = "17k7jfbdz7k440h6lws9baz8p9zlxgb41sig3w81h80nwzsjyqli"; features = { "default" = [ "std" ]; "serde" = [ "dep:serde" ]; @@ -2307,7 +2297,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; } ]; features = { @@ -2808,7 +2798,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; features = [ "full" ]; } ]; @@ -2840,9 +2830,9 @@ rec { }; "futures-timer" = rec { crateName = "futures-timer"; - version = "3.0.3"; + version = "3.0.4"; edition = "2018"; - sha256 = "094vw8k37djpbwv74bwf2qb7n6v6ghif4myss6smd6hgyajb127j"; + sha256 = "0s39in8ivw7g4d37pf31q02y44zd1hpfkd1pgra2slcqibdzlhxg"; libName = "futures_timer"; authors = [ "Alex Crichton " @@ -3100,9 +3090,9 @@ rec { }; "git2" = rec { crateName = "git2"; - version = "0.20.4"; - edition = "2018"; - sha256 = "0azykjpk3j6s354z23jkyq3r3pbmlw9ha1zsxkw5cnnpi1h2b23v"; + version = "0.21.0"; + edition = "2021"; + sha256 = "0bmqga9vlyx5sdlr0i28z0362s89xv9i4qcv20vvx9j54y9vzpfx"; authors = [ "Josh Triplett " "Alex Crichton " @@ -3124,17 +3114,14 @@ rec { name = "log"; packageId = "log"; } - { - name = "url"; - packageId = "url"; - } ]; features = { - "default" = [ "ssh" "https" ]; - "https" = [ "libgit2-sys/https" "openssl-sys" "openssl-probe" ]; + "cred" = [ "dep:url" ]; + "https" = [ "libgit2-sys/https" "openssl-sys" "openssl-probe" "cred" ]; "openssl-probe" = [ "dep:openssl-probe" ]; "openssl-sys" = [ "dep:openssl-sys" ]; - "ssh" = [ "libgit2-sys/ssh" ]; + "ssh" = [ "libgit2-sys/ssh" "cred" ]; + "unstable-sha256" = [ "libgit2-sys/unstable-sha256" ]; "vendored-libgit2" = [ "libgit2-sys/vendored" ]; "vendored-openssl" = [ "openssl-sys/vendored" "libgit2-sys/vendored-openssl" ]; "zlib-ng-compat" = [ "libgit2-sys/zlib-ng-compat" ]; @@ -3224,9 +3211,9 @@ rec { }; "h2" = rec { crateName = "h2"; - version = "0.4.14"; + version = "0.4.15"; edition = "2021"; - sha256 = "0cw7jk7kn2vn6f8w8ssh6gis1mljnfjxd606gvi4sjpyjayfy7qp"; + sha256 = "0mgilh1g8gydcchqi6acs5l6j0gwg5jwpa64sj4b3ncb9v497c3c"; authors = [ "Carl Lerche " "Sean McArthur " @@ -3337,14 +3324,11 @@ rec { }; resolvedDefaultFeatures = [ "allocator-api2" "default" "default-hasher" "equivalent" "inline-more" "raw-entry" ]; }; - "hashbrown 0.17.0" = rec { + "hashbrown 0.17.1" = rec { crateName = "hashbrown"; - version = "0.17.0"; + version = "0.17.1"; edition = "2024"; - sha256 = "0l8gvcz80lvinb7x22h53cqbi2y1fm603y2jhhh9qwygvkb7sijg"; - authors = [ - "Amanieu d'Antras " - ]; + sha256 = "0jmqz7i4yl6cm7rbn0i2ffkfrmwi6xkmzkaldr2v8bcsx2v0jngd"; features = { "alloc" = [ "dep:alloc" ]; "allocator-api2" = [ "dep:allocator-api2" ]; @@ -3419,9 +3403,9 @@ rec { }; "http" = rec { crateName = "http"; - version = "1.4.0"; + version = "1.4.2"; edition = "2021"; - sha256 = "06iind4cwsj1d6q8c2xgq8i2wka4ps74kmws24gsi1bzdlw2mfp3"; + sha256 = "09b4p8fiivkg7wm0b59fyrn1jkm7px298ci7zb9igz6n647gaw39"; authors = [ "Alex Crichton " "Carl Lerche " @@ -3538,9 +3522,9 @@ rec { }; "hyper" = rec { crateName = "hyper"; - version = "1.9.0"; + version = "1.10.1"; edition = "2021"; - sha256 = "1jmwbwqcaficskg76kq402gbymbnh2z4v99xwq3l5aa6n8bg16b2"; + sha256 = "1624nwrh1ci34psqcl3q8q266kha8kd6fmqjj14qck49l59iqa2m"; authors = [ "Sean McArthur " ]; @@ -4347,7 +4331,7 @@ rec { } { name = "hashbrown"; - packageId = "hashbrown 0.17.0"; + packageId = "hashbrown 0.17.1"; usesDefaultFeatures = false; } ]; @@ -4405,39 +4389,6 @@ rec { }; resolvedDefaultFeatures = [ "default" "std" ]; }; - "iri-string" = rec { - crateName = "iri-string"; - version = "0.7.12"; - edition = "2021"; - sha256 = "082fpx6c5ghvmqpwxaf2b268m47z2ic3prajqbmi1s1qpfj5kri5"; - libName = "iri_string"; - authors = [ - "YOSHIOKA Takuma " - ]; - dependencies = [ - { - name = "memchr"; - packageId = "memchr"; - optional = true; - usesDefaultFeatures = false; - } - { - name = "serde"; - packageId = "serde"; - optional = true; - usesDefaultFeatures = false; - features = [ "derive" ]; - } - ]; - features = { - "alloc" = [ "serde?/alloc" ]; - "default" = [ "std" ]; - "memchr" = [ "dep:memchr" ]; - "serde" = [ "dep:serde" ]; - "std" = [ "alloc" "memchr?/std" "serde?/std" ]; - }; - resolvedDefaultFeatures = [ "alloc" "default" "std" ]; - }; "is_terminal_polyfill" = rec { crateName = "is_terminal_polyfill"; version = "1.70.2"; @@ -4507,9 +4458,9 @@ rec { }; "jiff" = rec { crateName = "jiff"; - version = "0.2.24"; + version = "0.2.28"; edition = "2021"; - sha256 = "0g87al8yqp05m63dhqzi359xgsslc0grqz00nvfdyq8dcayms2zh"; + sha256 = "00lixngcc7amh2fcsxfr0z38j06lllhapz192biv1qj97q1x60s6"; authors = [ "Andrew Gallant " ]; @@ -4555,12 +4506,10 @@ rec { usesDefaultFeatures = false; } { - name = "windows-sys"; - packageId = "windows-sys 0.61.2"; + name = "windows-link"; + packageId = "windows-link"; optional = true; - usesDefaultFeatures = false; target = { target, features }: (target."windows" or false); - features = [ "Win32_Foundation" "Win32_System_Time" ]; } ]; devDependencies = [ @@ -4579,7 +4528,7 @@ rec { "static-tz" = [ "dep:jiff-static" ]; "std" = [ "alloc" "log?/std" "serde_core?/std" ]; "tz-fat" = [ "jiff-static?/tz-fat" ]; - "tz-system" = [ "std" "dep:windows-sys" ]; + "tz-system" = [ "std" "dep:windows-link" ]; "tzdb-bundle-always" = [ "dep:jiff-tzdb" "alloc" ]; "tzdb-bundle-platform" = [ "dep:jiff-tzdb-platform" "alloc" ]; "tzdb-concatenated" = [ "std" ]; @@ -4589,9 +4538,9 @@ rec { }; "jiff-static" = rec { crateName = "jiff-static"; - version = "0.2.24"; + version = "0.2.28"; edition = "2021"; - sha256 = "1mz6v0d1hd8wjgfzccgda5g9z01s1yxnyiizvahjw0pq1w1xw070"; + sha256 = "0irbhfh2f4i9w5l53jcmh6ssnhdd92wfy76978chgwnxilvk4bbq"; procMacro = true; libName = "jiff_static"; authors = [ @@ -4608,7 +4557,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; } ]; features = { @@ -4671,9 +4620,9 @@ rec { }; "js-sys" = rec { crateName = "js-sys"; - version = "0.3.97"; + version = "0.3.102"; edition = "2021"; - sha256 = "1kyaxgn1sm5am98jb48aj5j7r7s98kdrab41la5wzys5q2a0r151"; + sha256 = "0cgxklnyrfpzvf32cvdl3x5d070kfsv7ykdxfl3yizwdjqq4rl03"; libName = "js_sys"; authors = [ "The wasm-bindgen Developers" @@ -4690,11 +4639,6 @@ rec { usesDefaultFeatures = false; features = [ "std" ]; } - { - name = "once_cell"; - packageId = "once_cell"; - usesDefaultFeatures = false; - } { name = "wasm-bindgen"; packageId = "wasm-bindgen"; @@ -5378,7 +5322,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; features = [ "extra-traits" ]; } ]; @@ -5551,10 +5495,10 @@ rec { }; "libgit2-sys" = rec { crateName = "libgit2-sys"; - version = "0.18.3+1.9.2"; + version = "0.18.5+1.9.4"; edition = "2021"; links = "git2"; - sha256 = "11rlbyihj3k35mnkxxz4yvsnlx33a4r9srl66c5vp08pp72arcy9"; + sha256 = "18lwqnhy7qxg4iw24s1a0n7aj7qbnryry1iy0w32k4f1xbk6lp80"; libName = "libgit2_sys"; libPath = "lib.rs"; authors = [ @@ -5612,10 +5556,10 @@ rec { }; "libz-sys" = rec { crateName = "libz-sys"; - version = "1.1.28"; + version = "1.1.29"; edition = "2018"; links = "z"; - sha256 = "08hyf9v85zifl3353xc7i5wr53v9b3scri856cmphl3gaxp24fpw"; + sha256 = "1n98kqya7a7a0cxf5n5z3g13rj7a1vqxynk2xc7bja1qfxbrdg45"; libName = "libz_sys"; authors = [ "Alex Crichton " @@ -5692,9 +5636,9 @@ rec { }; "log" = rec { crateName = "log"; - version = "0.4.29"; + version = "0.4.32"; edition = "2021"; - sha256 = "15q8j9c8g5zpkcw0hnd6cf2z7fxqnvsjh3rw5mv5q10r83i34l2y"; + sha256 = "0fmdg0cxig7i4fwf1sw7fmg4d1gdbfzniawcfpwydy1q7320fgwm"; authors = [ "The Rust Project Developers" ]; @@ -5748,9 +5692,9 @@ rec { }; "memchr" = rec { crateName = "memchr"; - version = "2.8.0"; + version = "2.8.2"; edition = "2021"; - sha256 = "0y9zzxcqxvdqg6wyag7vc3h0blhdn7hkq164bxyx2vph8zs5ijpq"; + sha256 = "1i33wr49pcz2sbd12nds3n9fszay8kq5bk78gwciz462mcs49448"; authors = [ "Andrew Gallant " "bluss" @@ -5811,9 +5755,9 @@ rec { }; "mio" = rec { crateName = "mio"; - version = "1.2.0"; + version = "1.2.1"; edition = "2021"; - sha256 = "1hanrh4fwsfkdqdaqfidz48zz1wdix23zwn3r2x78am0garfbdsh"; + sha256 = "1nkggmrlnjs93w8rja4lvjj4aml1xqahgimv1h0p7d373kvhmg82"; authors = [ "Carl Lerche " "Thomas de Zeeuw " @@ -5949,9 +5893,9 @@ rec { }; "num-conv" = rec { crateName = "num-conv"; - version = "0.2.1"; + version = "0.2.2"; edition = "2021"; - sha256 = "0rqrr29brafaa2za352pbmhkk556n7f8z9rrkgmjp1idvdl3fry6"; + sha256 = "0hg4f9bwmy7cwpxdkm165dmkfc8jhkkayci234jsmi5ssb33j5sj"; libName = "num_conv"; authors = [ "Jacob Pratt " @@ -6872,7 +6816,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; } ]; features = { @@ -6911,9 +6855,9 @@ rec { }; "pin-project" = rec { crateName = "pin-project"; - version = "1.1.12"; + version = "1.1.13"; edition = "2021"; - sha256 = "1sbcs3s240z2w4jaga53c3jl5maw4qprf0a9kfcagcq0h7kdkw6b"; + sha256 = "09091qp946lpmjz4yp0xil1r5v4hgc91fi19dg5csayhdqrv4ri4"; libName = "pin_project"; dependencies = [ { @@ -6925,9 +6869,9 @@ rec { }; "pin-project-internal" = rec { crateName = "pin-project-internal"; - version = "1.1.12"; + version = "1.1.13"; edition = "2021"; - sha256 = "12a3c85sa005ahk1qm673h1akx2fa8qfvpb0ybd5aj788cpy5459"; + sha256 = "12rzlh07i1sdgrvzj6wgkka5bjqyvbfsl8knq6qi7g16m7q9aqy9"; procMacro = true; libName = "pin_project_internal"; dependencies = [ @@ -6941,7 +6885,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; usesDefaultFeatures = false; features = [ "parsing" "printing" "clone-impls" "proc-macro" "full" "visit-mut" ]; } @@ -7274,9 +7218,9 @@ rec { }; "prost" = rec { crateName = "prost"; - version = "0.14.3"; + version = "0.14.4"; edition = "2021"; - sha256 = "0s057z9nzggzy7x4bbsiar852hg7zb81f4z4phcdb0ig99971snj"; + sha256 = "1qas5v5rap45f43v3ja0jngxrrafrkcwl0iw5a3ld1pz2rscd2jj"; authors = [ "Dan Burkert " "Lucio Franco " @@ -7303,9 +7247,9 @@ rec { }; "prost-derive" = rec { crateName = "prost-derive"; - version = "0.14.3"; + version = "0.14.4"; edition = "2021"; - sha256 = "02zvva6kb0pfvlyc4nac6gd37ncjrs8jq5scxcq4nbqkc8wh5ii7"; + sha256 = "1pqa77d7da5pf6ba3kjj7510m5cynz6902ax01ckvr0pfrgv4w5m"; procMacro = true; libName = "prost_derive"; authors = [ @@ -7333,7 +7277,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; features = [ "extra-traits" ]; } ]; @@ -7341,9 +7285,9 @@ rec { }; "prost-types" = rec { crateName = "prost-types"; - version = "0.14.3"; + version = "0.14.4"; edition = "2021"; - sha256 = "1mrxrciryfgi6a0vmrgyj3g27r9hdhlgwkq71cgv3icbvg5w94c9"; + sha256 = "02ivjvc4cwl5bfgjs3l00hwlrk74z8zlg1xcgx60bww8fvf6fjgr"; libName = "prost_types"; authors = [ "Dan Burkert " @@ -7639,16 +7583,16 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; } ]; }; "regex" = rec { crateName = "regex"; - version = "1.12.3"; + version = "1.12.4"; edition = "2021"; - sha256 = "0xp2q0x7ybmpa5zlgaz00p8zswcirj9h8nry3rxxsdwi9fhm81z1"; + sha256 = "1fm6si2xpmhwqflabdqsakc0qkq718wx2ljl37nbj75fb5vjnagi"; authors = [ "The Rust Project Developers" "Andrew Gallant " @@ -7765,9 +7709,9 @@ rec { }; "regex-syntax" = rec { crateName = "regex-syntax"; - version = "0.8.10"; + version = "0.8.11"; edition = "2021"; - sha256 = "02jx311ka0daxxc7v45ikzhcl3iydjbbb0mdrpc1xgg8v7c7v2fw"; + sha256 = "1m25h5q2wp976fb9gc3dsc9l99svcvd5cri8lncb51c46ydgzxnn"; libName = "regex_syntax"; authors = [ "The Rust Project Developers" @@ -8270,7 +8214,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; features = [ "full" "parsing" "extra-traits" "visit" "visit-mut" ]; } { @@ -8374,9 +8318,9 @@ rec { }; "rustls-native-certs" = rec { crateName = "rustls-native-certs"; - version = "0.8.3"; + version = "0.8.4"; edition = "2021"; - sha256 = "0qrajg2n90bcr3bcq6j95gjm7a9lirfkkdmjj32419dyyzan0931"; + sha256 = "0kgazl8zc1sv63qg179bz96ilzh56lzfa5k92ji7d265f4kibdfs"; libName = "rustls_native_certs"; dependencies = [ { @@ -8612,13 +8556,13 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; } ]; devDependencies = [ { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; features = [ "extra-traits" ]; } ]; @@ -8902,7 +8846,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; usesDefaultFeatures = false; features = [ "clone-impls" "derive" "parsing" "printing" "proc-macro" ]; } @@ -8934,7 +8878,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; usesDefaultFeatures = false; features = [ "clone-impls" "derive" "parsing" "printing" ]; } @@ -8943,9 +8887,9 @@ rec { }; "serde_json" = rec { crateName = "serde_json"; - version = "1.0.149"; + version = "1.0.150"; edition = "2021"; - sha256 = "11jdx4vilzrjjd1dpgy67x5lgzr0laplz30dhv75lnf5ffa07z43"; + sha256 = "1ffgfhy9kndjnrz8lmy95pr758p2zk8dxv6yi99x0vkkni24w0g8"; authors = [ "Erick Tryzelaar " "David Tolnay " @@ -9186,9 +9130,9 @@ rec { }; "shlex" = rec { crateName = "shlex"; - version = "1.3.0"; - edition = "2015"; - sha256 = "0r1y6bv26c1scpxvhg2cabimrmwgbp4p3wy6syj9n0c4s3q2znhg"; + version = "2.0.1"; + edition = "2018"; + sha256 = "1fjsll1cd7d2bcpdij9kd6w62rpbc7qqzvydvs021vsmr1cxvypq"; authors = [ "comex " "Fenhl " @@ -9283,9 +9227,9 @@ rec { }; "smallvec" = rec { crateName = "smallvec"; - version = "1.15.1"; + version = "1.15.2"; edition = "2018"; - sha256 = "00xxdxxpgyq5vjnpljvkmy99xij5rxgh913ii1v16kzynnivgcb7"; + sha256 = "143wzbqf6vgapdp2z4qpl0yvlqcn17s8cnk8m28rqly808zsdmlf"; authors = [ "The Servo Project Developers" ]; @@ -9457,7 +9401,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; features = [ "full" ]; } ]; @@ -9493,7 +9437,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; usesDefaultFeatures = false; features = [ "clone-impls" "derive" "full" "parsing" "printing" "proc-macro" "visit-mut" ]; } @@ -9503,9 +9447,9 @@ rec { }; "socket2" = rec { crateName = "socket2"; - version = "0.6.3"; + version = "0.6.4"; edition = "2021"; - sha256 = "0gkjjcyn69hqhhlh5kl8byk5m0d7hyrp2aqwzbs3d33q208nwxis"; + sha256 = "0ldyp5rhba15spwxj1n94xh7sjks1398c3vwpwkxkd1087nwzlaj"; authors = [ "Alex Crichton " "Thomas de Zeeuw " @@ -9725,11 +9669,6 @@ rec { packageId = "futures 0.3.32"; features = [ "compat" ]; } - { - name = "json-patch"; - packageId = "json-patch"; - features = [ "schemars" ]; - } { name = "regex"; packageId = "regex"; @@ -9771,10 +9710,6 @@ rec { name = "tracing"; packageId = "tracing"; } - { - name = "uuid"; - packageId = "uuid"; - } ]; buildDependencies = [ { @@ -9797,6 +9732,10 @@ rec { packageId = "stackable-operator"; features = [ "webhook" "test-support" ]; } + { + name = "uuid"; + packageId = "uuid"; + } ]; features = { }; @@ -10031,7 +9970,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; } ]; @@ -10340,7 +10279,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; } ]; @@ -10535,7 +10474,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; features = [ "parsing" ]; } ]; @@ -10599,11 +10538,11 @@ rec { }; resolvedDefaultFeatures = [ "clone-impls" "default" "derive" "full" "parsing" "printing" "proc-macro" "quote" ]; }; - "syn 2.0.117" = rec { + "syn 2.0.118" = rec { crateName = "syn"; - version = "2.0.117"; + version = "2.0.118"; edition = "2021"; - sha256 = "16cv7c0wbn8amxc54n4w15kxlx5ypdmla8s0gxr2l7bv7s0bhrg6"; + sha256 = "08hlbc32lqd5d67p26ck7chg0rkclsw9as6f96vfn4s2j1zyb6hv"; authors = [ "David Tolnay " ]; @@ -10675,7 +10614,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; usesDefaultFeatures = false; features = [ "derive" "parsing" "printing" "clone-impls" "visit" "extra-traits" ]; } @@ -10742,7 +10681,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; } ]; @@ -10768,7 +10707,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; } ]; @@ -10792,9 +10731,9 @@ rec { }; "time" = rec { crateName = "time"; - version = "0.3.47"; + version = "0.3.49"; edition = "2024"; - sha256 = "0b7g9ly2iabrlgizliz6v5x23yq5d6bpp0mqz6407z1s526d8fvl"; + sha256 = "0sc4dgw6g187gvz5qj9iqqk2ashqzvdwi664b2183gbvsk1566ki"; authors = [ "Jacob Pratt " "Time contributors" @@ -10803,12 +10742,6 @@ rec { { name = "deranged"; packageId = "deranged"; - features = [ "powerfmt" ]; - } - { - name = "itoa"; - packageId = "itoa"; - optional = true; } { name = "num-conv"; @@ -10848,13 +10781,14 @@ rec { features = { "alloc" = [ "serde_core?/alloc" ]; "default" = [ "std" ]; - "formatting" = [ "dep:itoa" "std" "time-macros?/formatting" ]; + "formatting" = [ "std" "time-macros?/formatting" ]; "large-dates" = [ "time-core/large-dates" "time-macros?/large-dates" ]; "local-offset" = [ "std" "dep:libc" "dep:num_threads" ]; "macros" = [ "dep:time-macros" ]; "parsing" = [ "time-macros?/parsing" ]; "quickcheck" = [ "dep:quickcheck" "alloc" "deranged/quickcheck" ]; - "rand" = [ "rand08" "rand09" ]; + "rand" = [ "rand08" "rand09" "rand010" ]; + "rand010" = [ "dep:rand010" "deranged/rand010" ]; "rand08" = [ "dep:rand08" "deranged/rand08" ]; "rand09" = [ "dep:rand09" "deranged/rand09" ]; "serde" = [ "dep:serde_core" "time-macros?/serde" "deranged/serde" ]; @@ -10867,9 +10801,9 @@ rec { }; "time-core" = rec { crateName = "time-core"; - version = "0.1.8"; + version = "0.1.9"; edition = "2024"; - sha256 = "1jidl426mw48i7hjj4hs9vxgd9lwqq4vyalm4q8d7y4iwz7y353n"; + sha256 = "028ix0ax7ixp1h1k5zsqwgw85w6y1q32irslma7ci6ddd5kr074y"; libName = "time_core"; authors = [ "Jacob Pratt " @@ -10880,9 +10814,9 @@ rec { }; "time-macros" = rec { crateName = "time-macros"; - version = "0.2.27"; + version = "0.2.29"; edition = "2024"; - sha256 = "058ja265waq275wxvnfwavbz9r1hd4dgwpfn7a1a9a70l32y8w1f"; + sha256 = "0zf1ycfikg93ijf00qnprk801khqnqqga1zp0adbp73sfaim5iki"; procMacro = true; libName = "time_macros"; authors = [ @@ -10985,7 +10919,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; features = [ "parsing" ]; } ]; @@ -10997,9 +10931,9 @@ rec { }; "tokio" = rec { crateName = "tokio"; - version = "1.52.2"; + version = "1.52.3"; edition = "2021"; - sha256 = "11l3s4kn0f0da91pvhy62c9yfi03578j3wycqnrcvm8r7xc7h2hi"; + sha256 = "1zpzazypkg61sw91na1m85x5s4rsjym335fwwhwm1hcs70dz1iwg"; authors = [ "Tokio Contributors " ]; @@ -11137,7 +11071,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; features = [ "full" ]; } ]; @@ -11309,9 +11243,9 @@ rec { }; "toml_edit" = rec { crateName = "toml_edit"; - version = "0.25.11+spec-1.1.0"; + version = "0.25.12+spec-1.1.0"; edition = "2024"; - sha256 = "0awzffbkx33v9x4h19b5mfrwp3sn4ifr16y58sbk6j6l5v9c8n8b"; + sha256 = "1mx5paq837rjw7w51zprrjynk1vaig9yzxfqz9ac79jmd7f3w5fj"; dependencies = [ { name = "indexmap"; @@ -11364,9 +11298,9 @@ rec { }; "tonic" = rec { crateName = "tonic"; - version = "0.14.5"; - edition = "2021"; - sha256 = "1v4k7aa28m7722gz9qak2jiy7lis1ycm4fdmq63iip4m0qdcdizy"; + version = "0.14.6"; + edition = "2024"; + sha256 = "1vs5ci6z6b9xhfsnx4s8qx6bqi1zzcrxncjp71147a0gqwc5aamc"; authors = [ "Lucio Franco " ]; @@ -11493,9 +11427,9 @@ rec { }; "tonic-prost" = rec { crateName = "tonic-prost"; - version = "0.14.5"; - edition = "2021"; - sha256 = "02fkg2bv87q0yds2wz3w0s7i1x6qcgbrl00dy6ipajdapfh7clx5"; + version = "0.14.6"; + edition = "2024"; + sha256 = "184y40nf0iyzc5rg32ivgd88snv68sqy1kchynn55r1vhml9z12h"; libName = "tonic_prost"; authors = [ "Lucio Franco " @@ -11519,9 +11453,9 @@ rec { }; "tonic-types" = rec { crateName = "tonic-types"; - version = "0.14.5"; - edition = "2021"; - sha256 = "16bk1cxi2m0xgaabf98nnj7dn9j16ymkh27jq4s3shjm4a85m1ra"; + version = "0.14.6"; + edition = "2024"; + sha256 = "1s286gg71pjajny8xar0azq1w9lgz1ks3jm3pccxb0qz0q11pavk"; libName = "tonic_types"; authors = [ "Lucio Franco " @@ -11664,9 +11598,9 @@ rec { }; "tower-http" = rec { crateName = "tower-http"; - version = "0.6.8"; + version = "0.6.11"; edition = "2018"; - sha256 = "1y514jwzbyrmrkbaajpwmss4rg0mak82k16d6588w9ncaffmbrnl"; + sha256 = "0h08wjgs3hwnq11iwwzlmnabn1h4cl0fzd48svaccvqffkiggz2c"; libName = "tower_http"; authors = [ "Tower Maintainers " @@ -11700,11 +11634,6 @@ rec { packageId = "http-body"; optional = true; } - { - name = "iri-string"; - packageId = "iri-string"; - optional = true; - } { name = "mime"; packageId = "mime"; @@ -11734,6 +11663,11 @@ rec { optional = true; usesDefaultFeatures = false; } + { + name = "url"; + packageId = "url"; + optional = true; + } ]; devDependencies = [ { @@ -11755,35 +11689,33 @@ rec { } ]; features = { - "async-compression" = [ "dep:async-compression" ]; "auth" = [ "base64" "validate-request" ]; "base64" = [ "dep:base64" ]; "catch-panic" = [ "tracing" "futures-util/std" "dep:http-body" "dep:http-body-util" ]; - "compression-br" = [ "async-compression/brotli" "futures-core" "dep:http-body" "tokio-util" "tokio" ]; - "compression-deflate" = [ "async-compression/zlib" "futures-core" "dep:http-body" "tokio-util" "tokio" ]; + "compression-br" = [ "dep:async-compression" "async-compression?/brotli" "futures-core" "dep:http-body" "tokio-util" "dep:tokio" ]; + "compression-deflate" = [ "dep:async-compression" "async-compression?/zlib" "futures-core" "dep:http-body" "tokio-util" "dep:tokio" ]; "compression-full" = [ "compression-br" "compression-deflate" "compression-gzip" "compression-zstd" ]; - "compression-gzip" = [ "async-compression/gzip" "futures-core" "dep:http-body" "tokio-util" "tokio" ]; - "compression-zstd" = [ "async-compression/zstd" "futures-core" "dep:http-body" "tokio-util" "tokio" ]; - "decompression-br" = [ "async-compression/brotli" "futures-core" "dep:http-body" "dep:http-body-util" "tokio-util" "tokio" ]; - "decompression-deflate" = [ "async-compression/zlib" "futures-core" "dep:http-body" "dep:http-body-util" "tokio-util" "tokio" ]; + "compression-gzip" = [ "dep:async-compression" "async-compression?/gzip" "futures-core" "dep:http-body" "tokio-util" "dep:tokio" ]; + "compression-zstd" = [ "dep:async-compression" "async-compression?/zstd" "futures-core" "dep:http-body" "tokio-util" "dep:tokio" ]; + "decompression-br" = [ "dep:async-compression" "async-compression?/brotli" "futures-core" "dep:http-body" "dep:http-body-util" "tokio-util" "dep:tokio" ]; + "decompression-deflate" = [ "dep:async-compression" "async-compression?/zlib" "futures-core" "dep:http-body" "dep:http-body-util" "tokio-util" "dep:tokio" ]; "decompression-full" = [ "decompression-br" "decompression-deflate" "decompression-gzip" "decompression-zstd" ]; - "decompression-gzip" = [ "async-compression/gzip" "futures-core" "dep:http-body" "dep:http-body-util" "tokio-util" "tokio" ]; - "decompression-zstd" = [ "async-compression/zstd" "futures-core" "dep:http-body" "dep:http-body-util" "tokio-util" "tokio" ]; - "follow-redirect" = [ "futures-util" "dep:http-body" "iri-string" "tower/util" ]; - "fs" = [ "futures-core" "futures-util" "dep:http-body" "dep:http-body-util" "tokio/fs" "tokio-util/io" "tokio/io-util" "dep:http-range-header" "mime_guess" "mime" "percent-encoding" "httpdate" "set-status" "futures-util/alloc" "tracing" ]; - "full" = [ "add-extension" "auth" "catch-panic" "compression-full" "cors" "decompression-full" "follow-redirect" "fs" "limit" "map-request-body" "map-response-body" "metrics" "normalize-path" "propagate-header" "redirect" "request-id" "sensitive-headers" "set-header" "set-status" "timeout" "trace" "util" "validate-request" ]; + "decompression-gzip" = [ "dep:async-compression" "async-compression?/gzip" "futures-core" "dep:http-body" "dep:http-body-util" "tokio-util" "dep:tokio" ]; + "decompression-zstd" = [ "dep:async-compression" "async-compression?/zstd" "futures-core" "dep:http-body" "dep:http-body-util" "tokio-util" "dep:tokio" ]; + "follow-redirect" = [ "futures-util" "dep:http-body" "dep:url" "tower/util" ]; + "fs" = [ "dep:tokio" "tokio?/fs" "tokio?/io-util" "futures-core" "futures-util" "dep:http-body" "dep:http-body-util" "tokio-util/io" "dep:http-range-header" "mime_guess" "mime" "percent-encoding" "httpdate" "set-status" "futures-util/alloc" ]; + "full" = [ "add-extension" "auth" "catch-panic" "compression-full" "cors" "decompression-full" "follow-redirect" "fs" "limit" "map-request-body" "map-response-body" "metrics" "normalize-path" "on-early-drop" "propagate-header" "redirect" "request-id" "sensitive-headers" "set-header" "set-status" "timeout" "trace" "util" "validate-request" ]; "futures-core" = [ "dep:futures-core" ]; "futures-util" = [ "dep:futures-util" ]; "httpdate" = [ "dep:httpdate" ]; - "iri-string" = [ "dep:iri-string" ]; "limit" = [ "dep:http-body" "dep:http-body-util" ]; - "metrics" = [ "dep:http-body" "tokio/time" ]; + "metrics" = [ "dep:http-body" "dep:tokio" "tokio?/time" ]; "mime" = [ "dep:mime" ]; "mime_guess" = [ "dep:mime_guess" ]; + "on-early-drop" = [ "dep:http-body" ]; "percent-encoding" = [ "dep:percent-encoding" ]; "request-id" = [ "uuid" ]; - "timeout" = [ "dep:http-body" "tokio/time" ]; - "tokio" = [ "dep:tokio" ]; + "timeout" = [ "dep:http-body" "dep:tokio" "tokio?/time" ]; "tokio-util" = [ "dep:tokio-util" ]; "tower" = [ "dep:tower" ]; "trace" = [ "dep:http-body" "tracing" ]; @@ -11792,7 +11724,7 @@ rec { "uuid" = [ "dep:uuid" ]; "validate-request" = [ "mime" ]; }; - resolvedDefaultFeatures = [ "auth" "base64" "default" "follow-redirect" "futures-util" "iri-string" "map-response-body" "mime" "tower" "trace" "tracing" "util" "validate-request" ]; + resolvedDefaultFeatures = [ "auth" "base64" "default" "follow-redirect" "futures-util" "map-response-body" "mime" "tower" "trace" "tracing" "util" "validate-request" ]; }; "tower-layer" = rec { crateName = "tower-layer"; @@ -11926,7 +11858,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; usesDefaultFeatures = false; features = [ "full" "parsing" "printing" "visit-mut" "clone-impls" "extra-traits" "proc-macro" ]; } @@ -12236,13 +12168,9 @@ rec { }; "typenum" = rec { crateName = "typenum"; - version = "1.20.0"; + version = "1.20.1"; edition = "2018"; - sha256 = "1pj35y6q11d3y55gdl6g1h2dfhmybjming0jdi9bh0bpnqm11kj0"; - authors = [ - "Paho Lurie-Gregg " - "Andre Bogus " - ]; + sha256 = "086s9ly0906kw5yw41249fba97w5zfxf03pyfwdkffvcprqfixdn"; features = { "scale-info" = [ "dep:scale-info" ]; "scale_info" = [ "scale-info/derive" ]; @@ -12275,9 +12203,9 @@ rec { }; "unicode-segmentation" = rec { crateName = "unicode-segmentation"; - version = "1.13.2"; + version = "1.13.3"; edition = "2018"; - sha256 = "135a26m4a0wj319gcw28j6a5aqvz00jmgwgmcs6szgxjf942facn"; + sha256 = "1a47zaq83p386r3baq4m018xd5q4q0grdg56i1x042dzn71x7xf6"; libName = "unicode_segmentation"; authors = [ "kwantam " @@ -12405,9 +12333,9 @@ rec { }; "uuid" = rec { crateName = "uuid"; - version = "1.23.1"; + version = "1.23.3"; edition = "2021"; - sha256 = "0xlwg23rmsfl3gx98qsyzpl24pf4bs9wi3mqx5c6i319hyb4mmyx"; + sha256 = "1drddl03gi12vl1s3l2h371dw39plhn9wappp00v707g7h96nk8l"; authors = [ "Ashley Mannix" "Dylan DPC" @@ -12530,9 +12458,9 @@ rec { }; "wasip2" = rec { crateName = "wasip2"; - version = "1.0.3+wasi-0.2.9"; + version = "1.0.4+wasi-0.2.12"; edition = "2021"; - sha256 = "1mi3w855dz99xzjqc4aa8c9q5b6z1y5c963pkk4cvmr6vdr4c1i0"; + sha256 = "11wl7lqwq4pbmlmzr6n7bwz0hzy1z6sxc4554bkmrr86w4vznzmn"; dependencies = [ { name = "wit-bindgen"; @@ -12550,9 +12478,9 @@ rec { }; "wasm-bindgen" = rec { crateName = "wasm-bindgen"; - version = "0.2.120"; + version = "0.2.125"; edition = "2021"; - sha256 = "1cax9wy1n67sa2m16ia72lsxdrc5pzcv47psxp4p833yp3cvclnz"; + sha256 = "06nakz7nfy0ymyp7a27wfbjwx69659i12117hkgddkiv2iwkznwd"; libName = "wasm_bindgen"; authors = [ "The wasm-bindgen Developers" @@ -12601,9 +12529,9 @@ rec { }; "wasm-bindgen-futures" = rec { crateName = "wasm-bindgen-futures"; - version = "0.4.70"; + version = "0.4.75"; edition = "2021"; - sha256 = "1130a64yig0p10mk7rnq5l2jpwglbyxpnqg6h0nlqwzcmir4i4xg"; + sha256 = "104jssshr6cm5hmkn6c66mbkyxgaaphng6c17g0dmj7jhk918fsh"; libName = "wasm_bindgen_futures"; authors = [ "The wasm-bindgen Developers" @@ -12629,9 +12557,9 @@ rec { }; "wasm-bindgen-macro" = rec { crateName = "wasm-bindgen-macro"; - version = "0.2.120"; + version = "0.2.125"; edition = "2021"; - sha256 = "00xixpydzjd6y9knwdsrsiff6wi1ddszb1fa9bk25csz94gh9cbq"; + sha256 = "0g9w68dwcs4ylm5kxf7schi0kjdfarhc9qlnf8arxc9zn62a28af"; procMacro = true; libName = "wasm_bindgen_macro"; authors = [ @@ -12653,9 +12581,9 @@ rec { }; "wasm-bindgen-macro-support" = rec { crateName = "wasm-bindgen-macro-support"; - version = "0.2.120"; + version = "0.2.125"; edition = "2021"; - sha256 = "0h8v5aphaaq155fzz2d312zrxbka1x6lsvb8mhc8m60n0kr0zkcx"; + sha256 = "1gayzdx5iwl8gllh7ys79wg9cf4iyasl9hrzzhh5m4xx6nfgvkpy"; libName = "wasm_bindgen_macro_support"; authors = [ "The wasm-bindgen Developers" @@ -12675,7 +12603,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; features = [ "visit" "visit-mut" "full" "extra-traits" ]; } { @@ -12689,10 +12617,10 @@ rec { }; "wasm-bindgen-shared" = rec { crateName = "wasm-bindgen-shared"; - version = "0.2.120"; + version = "0.2.125"; edition = "2021"; links = "wasm_bindgen"; - sha256 = "1sjrac4f4j5pgw42mxadq9v42f0bji1a2rcksrbnrwgbh8y7nxa9"; + sha256 = "07w7fy5qa14ys3p8v2p84h98yqinw713smibz9v7apcspd29x4r3"; libName = "wasm_bindgen_shared"; authors = [ "The wasm-bindgen Developers" @@ -12707,9 +12635,9 @@ rec { }; "web-sys" = rec { crateName = "web-sys"; - version = "0.3.97"; + version = "0.3.102"; edition = "2021"; - sha256 = "00knh8cizgb01bmh362f3f19b11f8zl1y3gj6h47pk95233vmb9f"; + sha256 = "0786aybrnwsgdmcynhc2k5ii291a02rq9zk054j35csyvxr0lhx6"; libName = "web_sys"; authors = [ "The wasm-bindgen Developers" @@ -12793,6 +12721,7 @@ rec { "CssStyleSheet" = [ "StyleSheet" ]; "CssSupportsRule" = [ "CssConditionRule" "CssGroupingRule" "CssRule" ]; "CssTransition" = [ "Animation" "EventTarget" ]; + "CssViewTransitionRule" = [ "CssRule" ]; "CustomEvent" = [ "Event" ]; "DedicatedWorkerGlobalScope" = [ "EventTarget" "WorkerGlobalScope" ]; "DelayNode" = [ "AudioNode" "EventTarget" ]; @@ -13283,7 +13212,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; usesDefaultFeatures = false; features = [ "parsing" "proc-macro" "printing" "full" "clone-impls" ]; } @@ -13310,7 +13239,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; usesDefaultFeatures = false; features = [ "parsing" "proc-macro" "printing" "full" "clone-impls" ]; } @@ -13869,7 +13798,7 @@ rec { "Win32_Web" = [ "Win32" ]; "Win32_Web_InternetExplorer" = [ "Win32_Web" ]; }; - resolvedDefaultFeatures = [ "Wdk" "Wdk_Foundation" "Wdk_Storage" "Wdk_Storage_FileSystem" "Wdk_System" "Wdk_System_IO" "Win32" "Win32_Foundation" "Win32_Networking" "Win32_Networking_WinSock" "Win32_Security" "Win32_Security_Authentication" "Win32_Security_Authentication_Identity" "Win32_Security_Credentials" "Win32_Security_Cryptography" "Win32_Storage" "Win32_Storage_FileSystem" "Win32_System" "Win32_System_Console" "Win32_System_Diagnostics" "Win32_System_Diagnostics_Debug" "Win32_System_IO" "Win32_System_LibraryLoader" "Win32_System_Memory" "Win32_System_Pipes" "Win32_System_SystemInformation" "Win32_System_SystemServices" "Win32_System_Threading" "Win32_System_Time" "Win32_System_WindowsProgramming" "default" ]; + resolvedDefaultFeatures = [ "Wdk" "Wdk_Foundation" "Wdk_Storage" "Wdk_Storage_FileSystem" "Wdk_System" "Wdk_System_IO" "Win32" "Win32_Foundation" "Win32_Networking" "Win32_Networking_WinSock" "Win32_Security" "Win32_Security_Authentication" "Win32_Security_Authentication_Identity" "Win32_Security_Credentials" "Win32_Security_Cryptography" "Win32_Storage" "Win32_Storage_FileSystem" "Win32_System" "Win32_System_Console" "Win32_System_Diagnostics" "Win32_System_Diagnostics_Debug" "Win32_System_IO" "Win32_System_LibraryLoader" "Win32_System_Memory" "Win32_System_Pipes" "Win32_System_SystemInformation" "Win32_System_SystemServices" "Win32_System_Threading" "Win32_System_WindowsProgramming" "default" ]; }; "windows-targets" = rec { crateName = "windows-targets"; @@ -14006,9 +13935,9 @@ rec { }; "winnow" = rec { crateName = "winnow"; - version = "1.0.2"; + version = "1.0.3"; edition = "2021"; - sha256 = "1l7xnfvlgy4da6gq5ip2bgcm8i9d0rwzaxg1p88nlw8lxy5p1q9f"; + sha256 = "1wajycd3krn6h699vydjv7hm0ll5l31p899qzpk59y2is74y34h5"; dependencies = [ { name = "memchr"; @@ -14149,9 +14078,9 @@ rec { }; "yoke" = rec { crateName = "yoke"; - version = "0.8.2"; + version = "0.8.3"; edition = "2021"; - sha256 = "1jprcs7a98a5whvfs6r3jvfh1nnfp6zyijl7y4ywmn88lzywbs5b"; + sha256 = "1xgyj6c2lxj2bp891ynmhws87c6z7yyv2li1v0ss9di40hxf57vh"; authors = [ "Manish Goregaokar " ]; @@ -14203,7 +14132,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; features = [ "fold" ]; } { @@ -14215,9 +14144,9 @@ rec { }; "zerocopy" = rec { crateName = "zerocopy"; - version = "0.8.48"; + version = "0.8.52"; edition = "2021"; - sha256 = "1sb8plax8jbrsng1jdval7bdhk7hhrx40dz3hwh074k6knzkgm7f"; + sha256 = "0gv563swc1yn3k8w3wjj07a8q293rkx99nfp3a25vzzmbycj446f"; authors = [ "Joshua Liebow-Feeser " "Jack Wrenn " @@ -14251,9 +14180,9 @@ rec { }; "zerocopy-derive" = rec { crateName = "zerocopy-derive"; - version = "0.8.48"; + version = "0.8.52"; edition = "2021"; - sha256 = "1m5s0g92cxggqc74j83k1priz24k3z93sj5gadppd20p9c4cvqvh"; + sha256 = "0c3rhsh4sd9kdym4z55zprybjkydy9y2gvw75d72aapcfa5z7rqs"; procMacro = true; libName = "zerocopy_derive"; authors = [ @@ -14271,14 +14200,14 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; features = [ "full" ]; } ]; devDependencies = [ { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; features = [ "visit" ]; } ]; @@ -14286,11 +14215,11 @@ rec { }; "zerofrom" = rec { crateName = "zerofrom"; - version = "0.1.7"; + version = "0.1.8"; edition = "2021"; - sha256 = "1py40in4rirc9q8w36q67pld0zk8ssg024xhh0cncxgal7ra3yk9"; + sha256 = "0wjjdj7gdmd0iq91gzkxl7dlv0nhkk80l4bmdpzh3a1yh48mmh0f"; authors = [ - "Manish Goregaokar " + "The ICU4X Project Developers" ]; dependencies = [ { @@ -14327,7 +14256,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; features = [ "fold" ]; } { @@ -14339,9 +14268,9 @@ rec { }; "zeroize" = rec { crateName = "zeroize"; - version = "1.8.2"; - edition = "2021"; - sha256 = "1l48zxgcv34d7kjskr610zqsm6j2b4fcr2vfh9jm9j1jgvk58wdr"; + version = "1.9.0"; + edition = "2024"; + sha256 = "0kpnij2v1ig6g2mhc0bnci0lrdfdhiq40afbc0fahajqc9jiag71"; authors = [ "The RustCrypto Project Developers" ]; @@ -14363,9 +14292,9 @@ rec { }; "zeroize_derive" = rec { crateName = "zeroize_derive"; - version = "1.4.3"; - edition = "2021"; - sha256 = "0bl5vd1lz27p4z336nximg5wrlw5j7jc8fxh7iv6r1wrhhav99c5"; + version = "1.5.0"; + edition = "2024"; + sha256 = "0a7kq8srk81pn23xqn7c9jw1jpnfy41ffn802x1zrqqgpdf6al1w"; procMacro = true; authors = [ "The RustCrypto Project Developers" @@ -14381,7 +14310,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; features = [ "full" "extra-traits" "visit" ]; } ]; @@ -14494,7 +14423,7 @@ rec { } { name = "syn"; - packageId = "syn 2.0.117"; + packageId = "syn 2.0.118"; features = [ "extra-traits" ]; } ]; diff --git a/Cargo.toml b/Cargo.toml index e18abb19..19ed9360 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,21 +12,20 @@ repository = "https://github.com/stackabletech/opensearch-operator" [workspace.dependencies] stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.111.1", features = ["webhook"] } -built = { version = "0.8.0", features = ["chrono", "git2"] } -clap = "4.5" +built = { version = "0.8", features = ["chrono", "git2"] } +clap = "4.6" futures = { version = "0.3", features = ["compat"] } -json-patch = { version = "4.2", features = ["schemars"] } pretty_assertions = "1.4" -regex = "1.11" +regex = "1.12" rstest = "0.26" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" serde_yaml = "0.9" snafu = { version = "0.9", features = ["futures"] } strum = { version = "0.28", features = ["derive"] } -tokio = { version = "1.47", features = ["full"] } +tokio = { version = "1.52", features = ["full"] } tracing = "0.1" -uuid = "1.18" +uuid = "1.23" [patch."https://github.com/stackabletech/operator-rs"] stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "smooth-operator" } diff --git a/rust/operator-binary/Cargo.toml b/rust/operator-binary/Cargo.toml index 4215b09d..d2ca5679 100644 --- a/rust/operator-binary/Cargo.toml +++ b/rust/operator-binary/Cargo.toml @@ -20,7 +20,6 @@ stackable-operator.workspace = true clap.workspace = true futures.workspace = true -json-patch.workspace = true regex.workspace = true serde.workspace = true serde_json.workspace = true @@ -29,7 +28,6 @@ snafu.workspace = true strum.workspace = true tokio.workspace = true tracing.workspace = true -uuid.workspace = true [build-dependencies] built.workspace = true @@ -38,3 +36,4 @@ built.workspace = true pretty_assertions.workspace = true rstest.workspace = true stackable-operator = { workspace = true, features = ["test-support"] } +uuid.workspace = true From cf6db8890795d67f6c0aad7f9ccddd604e108457 Mon Sep 17 00:00:00 2001 From: Siegfried Weber Date: Mon, 22 Jun 2026 09:28:39 +0200 Subject: [PATCH 06/10] Upgrade to stackable-operator-0.112.0 --- Cargo.lock | 20 ++++++++--------- Cargo.nix | 56 +++++++++++++++++++++++------------------------ Cargo.toml | 4 ++-- crate-hashes.json | 18 +++++++-------- 4 files changed, 49 insertions(+), 49 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fb633c4b..10eec159 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1517,7 +1517,7 @@ dependencies = [ [[package]] name = "k8s-version" version = "0.1.3" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#a728c7f0504f24293651c3eeec0d8b15c7fb9ccd" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.112.0#cef9e663f86846d175049cc1e2406efc4b542040" dependencies = [ "darling", "regex", @@ -2908,7 +2908,7 @@ checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "stackable-certs" version = "0.4.0" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#a728c7f0504f24293651c3eeec0d8b15c7fb9ccd" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.112.0#cef9e663f86846d175049cc1e2406efc4b542040" dependencies = [ "const-oid", "ecdsa", @@ -2952,8 +2952,8 @@ dependencies = [ [[package]] name = "stackable-operator" -version = "0.111.1" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#a728c7f0504f24293651c3eeec0d8b15c7fb9ccd" +version = "0.112.0" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.112.0#cef9e663f86846d175049cc1e2406efc4b542040" dependencies = [ "base64", "clap", @@ -2998,7 +2998,7 @@ dependencies = [ [[package]] name = "stackable-operator-derive" version = "0.3.1" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#a728c7f0504f24293651c3eeec0d8b15c7fb9ccd" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.112.0#cef9e663f86846d175049cc1e2406efc4b542040" dependencies = [ "darling", "proc-macro2", @@ -3009,7 +3009,7 @@ dependencies = [ [[package]] name = "stackable-shared" version = "0.1.1" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#a728c7f0504f24293651c3eeec0d8b15c7fb9ccd" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.112.0#cef9e663f86846d175049cc1e2406efc4b542040" dependencies = [ "jiff", "k8s-openapi", @@ -3026,7 +3026,7 @@ dependencies = [ [[package]] name = "stackable-telemetry" version = "0.6.4" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#a728c7f0504f24293651c3eeec0d8b15c7fb9ccd" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.112.0#cef9e663f86846d175049cc1e2406efc4b542040" dependencies = [ "axum", "clap", @@ -3050,7 +3050,7 @@ dependencies = [ [[package]] name = "stackable-versioned" version = "0.10.0" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#a728c7f0504f24293651c3eeec0d8b15c7fb9ccd" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.112.0#cef9e663f86846d175049cc1e2406efc4b542040" dependencies = [ "kube", "schemars", @@ -3064,7 +3064,7 @@ dependencies = [ [[package]] name = "stackable-versioned-macros" version = "0.10.0" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#a728c7f0504f24293651c3eeec0d8b15c7fb9ccd" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.112.0#cef9e663f86846d175049cc1e2406efc4b542040" dependencies = [ "convert_case", "convert_case_extras", @@ -3082,7 +3082,7 @@ dependencies = [ [[package]] name = "stackable-webhook" version = "0.9.1" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#a728c7f0504f24293651c3eeec0d8b15c7fb9ccd" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.112.0#cef9e663f86846d175049cc1e2406efc4b542040" dependencies = [ "arc-swap", "async-trait", diff --git a/Cargo.nix b/Cargo.nix index 8cf74806..533811b7 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -4827,9 +4827,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech//operator-rs.git"; - rev = "a728c7f0504f24293651c3eeec0d8b15c7fb9ccd"; - sha256 = "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i"; + url = "https://github.com/stackabletech/operator-rs.git"; + rev = "cef9e663f86846d175049cc1e2406efc4b542040"; + sha256 = "054p2mcinq3x4iykmc72nhga7kapc8ihkx9mnzqq3qdm2bk2qcps"; }; libName = "k8s_version"; authors = [ @@ -9547,9 +9547,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech//operator-rs.git"; - rev = "a728c7f0504f24293651c3eeec0d8b15c7fb9ccd"; - sha256 = "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i"; + url = "https://github.com/stackabletech/operator-rs.git"; + rev = "cef9e663f86846d175049cc1e2406efc4b542040"; + sha256 = "054p2mcinq3x4iykmc72nhga7kapc8ihkx9mnzqq3qdm2bk2qcps"; }; libName = "stackable_certs"; authors = [ @@ -9743,13 +9743,13 @@ rec { }; "stackable-operator" = rec { crateName = "stackable-operator"; - version = "0.111.1"; + version = "0.112.0"; edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech//operator-rs.git"; - rev = "a728c7f0504f24293651c3eeec0d8b15c7fb9ccd"; - sha256 = "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i"; + url = "https://github.com/stackabletech/operator-rs.git"; + rev = "cef9e663f86846d175049cc1e2406efc4b542040"; + sha256 = "054p2mcinq3x4iykmc72nhga7kapc8ihkx9mnzqq3qdm2bk2qcps"; }; libName = "stackable_operator"; authors = [ @@ -9946,9 +9946,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech//operator-rs.git"; - rev = "a728c7f0504f24293651c3eeec0d8b15c7fb9ccd"; - sha256 = "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i"; + url = "https://github.com/stackabletech/operator-rs.git"; + rev = "cef9e663f86846d175049cc1e2406efc4b542040"; + sha256 = "054p2mcinq3x4iykmc72nhga7kapc8ihkx9mnzqq3qdm2bk2qcps"; }; procMacro = true; libName = "stackable_operator_derive"; @@ -9981,9 +9981,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech//operator-rs.git"; - rev = "a728c7f0504f24293651c3eeec0d8b15c7fb9ccd"; - sha256 = "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i"; + url = "https://github.com/stackabletech/operator-rs.git"; + rev = "cef9e663f86846d175049cc1e2406efc4b542040"; + sha256 = "054p2mcinq3x4iykmc72nhga7kapc8ihkx9mnzqq3qdm2bk2qcps"; }; libName = "stackable_shared"; authors = [ @@ -10062,9 +10062,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech//operator-rs.git"; - rev = "a728c7f0504f24293651c3eeec0d8b15c7fb9ccd"; - sha256 = "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i"; + url = "https://github.com/stackabletech/operator-rs.git"; + rev = "cef9e663f86846d175049cc1e2406efc4b542040"; + sha256 = "054p2mcinq3x4iykmc72nhga7kapc8ihkx9mnzqq3qdm2bk2qcps"; }; libName = "stackable_telemetry"; authors = [ @@ -10172,9 +10172,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech//operator-rs.git"; - rev = "a728c7f0504f24293651c3eeec0d8b15c7fb9ccd"; - sha256 = "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i"; + url = "https://github.com/stackabletech/operator-rs.git"; + rev = "cef9e663f86846d175049cc1e2406efc4b542040"; + sha256 = "054p2mcinq3x4iykmc72nhga7kapc8ihkx9mnzqq3qdm2bk2qcps"; }; libName = "stackable_versioned"; authors = [ @@ -10222,9 +10222,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech//operator-rs.git"; - rev = "a728c7f0504f24293651c3eeec0d8b15c7fb9ccd"; - sha256 = "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i"; + url = "https://github.com/stackabletech/operator-rs.git"; + rev = "cef9e663f86846d175049cc1e2406efc4b542040"; + sha256 = "054p2mcinq3x4iykmc72nhga7kapc8ihkx9mnzqq3qdm2bk2qcps"; }; procMacro = true; libName = "stackable_versioned_macros"; @@ -10290,9 +10290,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech//operator-rs.git"; - rev = "a728c7f0504f24293651c3eeec0d8b15c7fb9ccd"; - sha256 = "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i"; + url = "https://github.com/stackabletech/operator-rs.git"; + rev = "cef9e663f86846d175049cc1e2406efc4b542040"; + sha256 = "054p2mcinq3x4iykmc72nhga7kapc8ihkx9mnzqq3qdm2bk2qcps"; }; libName = "stackable_webhook"; authors = [ diff --git a/Cargo.toml b/Cargo.toml index 19ed9360..0dbc53ac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ edition = "2024" repository = "https://github.com/stackabletech/opensearch-operator" [workspace.dependencies] -stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.111.1", features = ["webhook"] } +stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.112.0", features = ["webhook"] } built = { version = "0.8", features = ["chrono", "git2"] } clap = "4.6" @@ -28,4 +28,4 @@ tracing = "0.1" uuid = "1.23" [patch."https://github.com/stackabletech/operator-rs"] -stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "smooth-operator" } +# stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "main" } diff --git a/crate-hashes.json b/crate-hashes.json index 9a0b683e..667a9fc4 100644 --- a/crate-hashes.json +++ b/crate-hashes.json @@ -1,12 +1,12 @@ { - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#k8s-version@0.1.3": "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i", - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-certs@0.4.0": "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i", - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-operator-derive@0.3.1": "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i", - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-operator@0.111.1": "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i", - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-shared@0.1.1": "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i", - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-telemetry@0.6.4": "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i", - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-versioned-macros@0.10.0": "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i", - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-versioned@0.10.0": "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i", - "git+https://github.com/stackabletech//operator-rs.git?branch=smooth-operator#stackable-webhook@0.9.1": "0w1ms36idn8cj04nbi1dbqyd5cwy09wg8qcg1mrpxaflb8bpj96i", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.112.0#k8s-version@0.1.3": "054p2mcinq3x4iykmc72nhga7kapc8ihkx9mnzqq3qdm2bk2qcps", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.112.0#stackable-certs@0.4.0": "054p2mcinq3x4iykmc72nhga7kapc8ihkx9mnzqq3qdm2bk2qcps", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.112.0#stackable-operator-derive@0.3.1": "054p2mcinq3x4iykmc72nhga7kapc8ihkx9mnzqq3qdm2bk2qcps", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.112.0#stackable-operator@0.112.0": "054p2mcinq3x4iykmc72nhga7kapc8ihkx9mnzqq3qdm2bk2qcps", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.112.0#stackable-shared@0.1.1": "054p2mcinq3x4iykmc72nhga7kapc8ihkx9mnzqq3qdm2bk2qcps", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.112.0#stackable-telemetry@0.6.4": "054p2mcinq3x4iykmc72nhga7kapc8ihkx9mnzqq3qdm2bk2qcps", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.112.0#stackable-versioned-macros@0.10.0": "054p2mcinq3x4iykmc72nhga7kapc8ihkx9mnzqq3qdm2bk2qcps", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.112.0#stackable-versioned@0.10.0": "054p2mcinq3x4iykmc72nhga7kapc8ihkx9mnzqq3qdm2bk2qcps", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.112.0#stackable-webhook@0.9.1": "054p2mcinq3x4iykmc72nhga7kapc8ihkx9mnzqq3qdm2bk2qcps", "git+https://github.com/stackabletech/product-config.git?tag=0.8.0#product-config@0.8.0": "1dz70kapm2wdqcr7ndyjji0lhsl98bsq95gnb2lw487wf6yr7987" } \ No newline at end of file From ed9f5e9b06a270e3b5f0f7cbe252a863aa19496b Mon Sep 17 00:00:00 2001 From: Siegfried Weber Date: Mon, 22 Jun 2026 11:27:27 +0200 Subject: [PATCH 07/10] Update rust/operator-binary/src/controller/build/role_group_builder.rs Co-authored-by: maltesander --- .../src/controller/build/role_group_builder.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rust/operator-binary/src/controller/build/role_group_builder.rs b/rust/operator-binary/src/controller/build/role_group_builder.rs index 9673a04f..92bdc8e0 100644 --- a/rust/operator-binary/src/controller/build/role_group_builder.rs +++ b/rust/operator-binary/src/controller/build/role_group_builder.rs @@ -966,7 +966,11 @@ impl<'a> RoleGroupBuilder<'a> { fn security_settings_file_type_managed_by_env_var( file_type: &ExtendedSecuritySettingsFileType, ) -> EnvVarName { - EnvVarName::from_str(&format!("MANAGE_{}", file_type.id.to_uppercase())).expect( + EnvVarName::from_str(&format!( + "MANAGE_{file_type_id}", + file_type_id = file_type.id.to_uppercase() + )) + .expect( "The file type IDs are static strings which should produce valid environment variable \ names.", ) From 37ee8636c62bfde0ae1f9f6389fa9b94de14564f Mon Sep 17 00:00:00 2001 From: Siegfried Weber Date: Mon, 22 Jun 2026 11:39:14 +0200 Subject: [PATCH 08/10] Update changelog --- CHANGELOG.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 050c27da..3eefbc18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,13 @@ All notable changes to this project will be documented in this file. - Document Helm deployed RBAC permissions and remove unnecessary permissions ([#129]). - BREAKING: `configOverrides` now only accepts the known config file `opensearch.yml`. Previously, arbitrary file names were silently accepted and ignored ([#137]). -- Bump `stackable-operator` to 0.110.1 ([#137]). +- Bump `stackable-operator` to 0.112.0 ([#137], [#147]). +- Bump `clap` to 4.6 ([#147]). +- Bump `regex` to 1.12 ([#147]). +- Bump `tokio` to 1.52 ([#147]). +- Bump `uuid` to 1.23 ([#147]). +- Move the framework code to operator-rs. This introduces no user-visible changes, except that the + allowed length of role group names increases from 16 to 63 ([#147]). - test: Bump vector-aggregator to 0.55.0, replace /graphql call with gRPC call ([#146]). [#129]: https://github.com/stackabletech/opensearch-operator/pull/129 @@ -22,6 +28,7 @@ All notable changes to this project will be documented in this file. [#137]: https://github.com/stackabletech/opensearch-operator/pull/137 [#141]: https://github.com/stackabletech/opensearch-operator/pull/141 [#146]: https://github.com/stackabletech/opensearch-operator/pull/146 +[#147]: https://github.com/stackabletech/opensearch-operator/pull/147 ## [26.3.0] - 2026-03-16 From b6881bc130a114535c7c38eed296d75777757966 Mon Sep 17 00:00:00 2001 From: Siegfried Weber Date: Mon, 22 Jun 2026 11:48:45 +0200 Subject: [PATCH 09/10] test(logging): Use descriptive role group names equal to other operators --- .../10_opensearch-vector-aggregator-values.yaml.j2 | 8 ++++---- tests/templates/kuttl/logging/20-assert.yaml.j2 | 4 ++-- .../templates/kuttl/logging/20-install-opensearch.yaml.j2 | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/templates/kuttl/logging/10_opensearch-vector-aggregator-values.yaml.j2 b/tests/templates/kuttl/logging/10_opensearch-vector-aggregator-values.yaml.j2 index c6cb2ed6..be9a0b2e 100644 --- a/tests/templates/kuttl/logging/10_opensearch-vector-aggregator-values.yaml.j2 +++ b/tests/templates/kuttl/logging/10_opensearch-vector-aggregator-values.yaml.j2 @@ -30,28 +30,28 @@ customConfig: inputs: - validEvents condition: >- - .pod == "opensearch-nodes-automatic-0" && + .pod == "opensearch-nodes-automatic-log-config-0" && .container == "opensearch" filteredAutomaticLogConfigVector: type: filter inputs: - validEvents condition: >- - .pod == "opensearch-nodes-automatic-0" && + .pod == "opensearch-nodes-automatic-log-config-0" && .container == "vector" filteredCustomLogConfigOpenSearch: type: filter inputs: - validEvents condition: >- - .pod == "opensearch-nodes-custom-0" && + .pod == "opensearch-nodes-custom-log-config-0" && .container == "opensearch" filteredCustomLogConfigVector: type: filter inputs: - validEvents condition: >- - .pod == "opensearch-nodes-custom-0" && + .pod == "opensearch-nodes-custom-log-config-0" && .container == "vector" filteredInvalidEvents: type: filter diff --git a/tests/templates/kuttl/logging/20-assert.yaml.j2 b/tests/templates/kuttl/logging/20-assert.yaml.j2 index 76e2a2f4..cfffcf65 100644 --- a/tests/templates/kuttl/logging/20-assert.yaml.j2 +++ b/tests/templates/kuttl/logging/20-assert.yaml.j2 @@ -6,7 +6,7 @@ timeout: 600 apiVersion: apps/v1 kind: StatefulSet metadata: - name: opensearch-nodes-automatic + name: opensearch-nodes-automatic-log-config status: readyReplicas: 1 replicas: 1 @@ -14,7 +14,7 @@ status: apiVersion: apps/v1 kind: StatefulSet metadata: - name: opensearch-nodes-custom + name: opensearch-nodes-custom-log-config status: readyReplicas: 1 replicas: 1 diff --git a/tests/templates/kuttl/logging/20-install-opensearch.yaml.j2 b/tests/templates/kuttl/logging/20-install-opensearch.yaml.j2 index 0fa168e8..5343e575 100644 --- a/tests/templates/kuttl/logging/20-install-opensearch.yaml.j2 +++ b/tests/templates/kuttl/logging/20-install-opensearch.yaml.j2 @@ -38,7 +38,7 @@ spec: app.kubernetes.io/component: nodes app.kubernetes.io/instance: opensearch app.kubernetes.io/name: opensearch - app.kubernetes.io/role-group: automatic + app.kubernetes.io/role-group: automatic-log-config type: ClusterIP --- apiVersion: opensearch.stackable.tech/v1alpha1 @@ -56,7 +56,7 @@ spec: vectorAggregatorConfigMapName: opensearch-vector-aggregator-discovery nodes: roleGroups: - automatic: + automatic-log-config: config: logging: enableVectorAgent: true @@ -78,7 +78,7 @@ spec: ROOT: level: INFO replicas: 1 - custom: + custom-log-config: config: logging: enableVectorAgent: true From 2877f2e2e038cbe82b00ab110e69be971e9f7bc5 Mon Sep 17 00:00:00 2001 From: Siegfried Weber Date: Mon, 22 Jun 2026 11:54:14 +0200 Subject: [PATCH 10/10] Remove bump entries from the changelog --- CHANGELOG.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3eefbc18..5f4dea69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,10 +15,6 @@ All notable changes to this project will be documented in this file. - BREAKING: `configOverrides` now only accepts the known config file `opensearch.yml`. Previously, arbitrary file names were silently accepted and ignored ([#137]). - Bump `stackable-operator` to 0.112.0 ([#137], [#147]). -- Bump `clap` to 4.6 ([#147]). -- Bump `regex` to 1.12 ([#147]). -- Bump `tokio` to 1.52 ([#147]). -- Bump `uuid` to 1.23 ([#147]). - Move the framework code to operator-rs. This introduces no user-visible changes, except that the allowed length of role group names increases from 16 to 63 ([#147]). - test: Bump vector-aggregator to 0.55.0, replace /graphql call with gRPC call ([#146]).