diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 45f49b3c..0c58d98e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,7 @@ env: CARGO_TERM_COLOR: always CARGO_INCREMENTAL: '0' CARGO_PROFILE_DEV_DEBUG: '0' - RUST_TOOLCHAIN_VERSION: "1.80.1" + RUST_TOOLCHAIN_VERSION: "1.81.0" RUSTFLAGS: "-D warnings" RUSTDOCFLAGS: "-D warnings" RUST_LOG: "info" diff --git a/.github/workflows/pr_pre-commit.yaml b/.github/workflows/pr_pre-commit.yaml index 5a39364a..c9e94843 100644 --- a/.github/workflows/pr_pre-commit.yaml +++ b/.github/workflows/pr_pre-commit.yaml @@ -6,7 +6,7 @@ on: env: CARGO_TERM_COLOR: always - RUST_TOOLCHAIN_VERSION: "1.80.1" + RUST_TOOLCHAIN_VERSION: "1.81.0" HADOLINT_VERSION: "v2.12.0" PYTHON_VERSION: "3.12" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 98280921..3c59d32e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ default_language_version: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: 2c9f875913ee60ca25ce70243dc24d5b6415598c # 4.6.0 + rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # 5.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -28,7 +28,7 @@ repos: - id: yamllint - repo: https://github.com/igorshubovych/markdownlint-cli - rev: f295829140d25717bc79368d3f966fc1f67a824f # 0.41.0 + rev: aa975a18c9a869648007d33864034dbc7481fe5e # 0.42.0 hooks: - id: markdownlint types: [text] @@ -44,7 +44,7 @@ repos: # If you do not, you will need to delete the cached ruff binary shown in the # error message - repo: https://github.com/astral-sh/ruff-pre-commit - rev: f1ebc5730d98440041cc43e4d69829ad598ae1e7 # 0.6.3 + rev: 8983acb92ee4b01924893632cf90af926fa608f0 # 0.7.0 hooks: # Run the linter. - id: ruff @@ -52,7 +52,7 @@ repos: - id: ruff-format - repo: https://github.com/rhysd/actionlint - rev: 62dc61a45fc95efe8c800af7a557ab0b9165d63b # 1.7.1 + rev: 4e683ab8014a63fafa117492a0c6053758e6d593 # 1.7.3 hooks: - id: actionlint diff --git a/CHANGELOG.md b/CHANGELOG.md index cdc62671..1591bd9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## [Unreleased] +### Added + +- The operator can now run on Kubernetes clusters using a non-default cluster domain. + Use the env var `KUBERNETES_CLUSTER_DOMAIN` or the operator Helm chart property `kubernetesClusterDomain` to set a non-default cluster domain ([#574]). + ### Changed - Reduce CRD size from `1.4MB` to `96KB` by accepting arbitrary YAML input instead of the underlying schema for the following fields ([#548]): @@ -24,6 +29,7 @@ [#556]: https://github.com/stackabletech/hbase-operator/pull/556 [#558]: https://github.com/stackabletech/hbase-operator/pull/558 [#570]: https://github.com/stackabletech/hbase-operator/pull/570 +[#574]: https://github.com/stackabletech/hbase-operator/pull/574 ## [24.7.0] - 2024-07-24 diff --git a/Cargo.lock b/Cargo.lock index 527ef6c1..aa14a915 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -62,9 +62,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "23a1e53f0f5d86382dafe1cf314783b2044280f406e7e1506368220ad11b1338" dependencies = [ "anstyle", "anstyle-parse", @@ -77,43 +77,43 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "8365de52b16c035ff4fcafe0092ba9390540e3e352870ac09933bebcaa2c8c56" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.89" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" [[package]] name = "async-broadcast" @@ -146,7 +146,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -157,7 +157,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -242,9 +242,9 @@ dependencies = [ [[package]] name = "built" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "236e6289eda5a812bc6b53c3b024039382a2895fbbeef2d748b2931546d392c4" +checksum = "c360505aed52b7ec96a3636c3f039d99103c37d1d9b4f7a8c743d3ea9ffcd03b" dependencies = [ "chrono", "git2", @@ -264,15 +264,15 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "cc" -version = "1.1.30" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" dependencies = [ "jobserver", "libc", @@ -329,7 +329,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -340,9 +340,9 @@ checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "concurrent-queue" @@ -444,7 +444,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -455,7 +455,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -466,7 +466,7 @@ checksum = "bc2323e10c92e1cf4d86e11538512e6dc03ceb586842970b6332af3d4046a046" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -525,6 +525,18 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.85", +] + [[package]] name = "either" version = "1.13.0" @@ -533,9 +545,9 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if", ] @@ -549,6 +561,26 @@ dependencies = [ "thiserror", ] +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.85", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -673,7 +705,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1121,9 +1153,9 @@ dependencies = [ [[package]] name = "kube" -version = "0.95.0" +version = "0.96.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa21063c854820a77c5d7f8deeb7ffa55246d8304e4bcd8cce2956752c6604f8" +checksum = "efffeb3df0bd4ef3e5d65044573499c0e4889b988070b08c50b25b1329289a1f" dependencies = [ "k8s-openapi", "kube-client", @@ -1134,9 +1166,9 @@ dependencies = [ [[package]] name = "kube-client" -version = "0.95.0" +version = "0.96.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c2355f5c9d8a11900e71a6fe1e47abd5ec45bf971eb4b162ffe97b46db9bb7" +checksum = "8bf471ece8ff8d24735ce78dac4d091e9fcb8d74811aeb6b75de4d1c3f5de0f1" dependencies = [ "base64 0.22.1", "bytes", @@ -1172,9 +1204,9 @@ dependencies = [ [[package]] name = "kube-core" -version = "0.95.0" +version = "0.96.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3030bd91c9db544a50247e7d48d7db9cf633c172732dce13351854526b1e666" +checksum = "f42346d30bb34d1d7adc5c549b691bce7aa3a1e60254e68fab7e2d7b26fe3d77" dependencies = [ "chrono", "form_urlencoded", @@ -1190,29 +1222,29 @@ dependencies = [ [[package]] name = "kube-derive" -version = "0.95.0" +version = "0.96.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa98be978eddd70a773aa8e86346075365bfb7eb48783410852dbf7cb57f0c27" +checksum = "f9364e04cc5e0482136c6ee8b7fb7551812da25802249f35b3def7aaa31e82ad" dependencies = [ "darling", "proc-macro2", "quote", "serde_json", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] name = "kube-runtime" -version = "0.95.0" +version = "0.96.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5895cb8aa641ac922408f128b935652b34c2995f16ad7db0984f6caa50217914" +checksum = "d3fbf1f6ffa98e65f1d2a9a69338bb60605d46be7edf00237784b89e62c9bd44" dependencies = [ "ahash", "async-broadcast", "async-stream", "async-trait", "backoff", - "derivative", + "educe", "futures 0.3.31", "hashbrown 0.14.5", "json-patch", @@ -1237,9 +1269,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.160" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0b21006cd1874ae9e650973c565615676dc4a274c965bb0a73796dac838ce4f" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "libgit2-sys" @@ -1537,7 +1569,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1553,29 +1585,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -1615,9 +1647,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.88" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -1688,9 +1720,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -1753,9 +1785,9 @@ dependencies = [ [[package]] name = "rstest" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b423f0e62bdd61734b67cd21ff50871dfaeb9cc74f869dcd6af974fbcb19936" +checksum = "0a2c585be59b6b5dd66a9d2084aa1d8bd52fbdb806eafdeffb52791147862035" dependencies = [ "futures 0.3.31", "futures-timer", @@ -1765,9 +1797,9 @@ dependencies = [ [[package]] name = "rstest_macros" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e1711e7d14f74b12a58411c542185ef7fb7f2e7f8ee6e2940a883628522b42" +checksum = "825ea780781b15345a146be27eaefb05085e337e869bff01b4306a4fd4a9ad5a" dependencies = [ "cfg-if", "glob", @@ -1777,7 +1809,7 @@ dependencies = [ "regex", "relative-path", "rustc_version", - "syn 2.0.79", + "syn 2.0.85", "unicode-ident", ] @@ -1906,7 +1938,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1917,11 +1949,10 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "secrecy" -version = "0.8.0" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +checksum = "e891af845473308773346dc847b2c23ee78fe442e0472ac50e22a18a93d3ae5a" dependencies = [ - "serde", "zeroize", ] @@ -1956,9 +1987,9 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "3ea7893ff5e2466df8d720bb615088341b295f849602c6956047f8f80f0e9bc1" dependencies = [ "serde_derive", ] @@ -1975,13 +2006,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1992,14 +2023,14 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa", "memchr", @@ -2126,7 +2157,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -2185,8 +2216,8 @@ dependencies = [ [[package]] name = "stackable-operator" -version = "0.76.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.76.0#a7e70f174fb043a1766e0a80de95834cb4f7513d" +version = "0.80.0" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.80.0#6fbe32300b60f95e0baa2ab0ff2daf961b06531c" dependencies = [ "chrono", "clap", @@ -2196,6 +2227,7 @@ dependencies = [ "dockerfile-parser", "either", "futures 0.3.31", + "indexmap", "json-patch", "k8s-openapi", "kube", @@ -2210,6 +2242,7 @@ dependencies = [ "serde_yaml", "snafu 0.8.5", "stackable-operator-derive", + "stackable-shared", "strum", "tokio", "tracing", @@ -2222,12 +2255,24 @@ dependencies = [ [[package]] name = "stackable-operator-derive" version = "0.3.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.76.0#a7e70f174fb043a1766e0a80de95834cb4f7513d" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.80.0#6fbe32300b60f95e0baa2ab0ff2daf961b06531c" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", +] + +[[package]] +name = "stackable-shared" +version = "0.0.1" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.80.0#6fbe32300b60f95e0baa2ab0ff2daf961b06531c" +dependencies = [ + "kube", + "semver", + "serde", + "serde_yaml", + "snafu 0.8.5", ] [[package]] @@ -2255,7 +2300,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -2277,33 +2322,39 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -2386,9 +2437,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.40.0" +version = "1.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" dependencies = [ "backtrace", "bytes", @@ -2410,7 +2461,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -2468,14 +2519,14 @@ dependencies = [ [[package]] name = "tower" -version = "0.4.13" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" dependencies = [ "futures-core", "futures-util", - "pin-project", "pin-project-lite", + "sync_wrapper", "tokio", "tokio-util", "tower-layer", @@ -2485,16 +2536,15 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.5.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" +checksum = "8437150ab6bbc8c5f0f519e3d5ed4aa883a83dd4cdd3d1b21f9482936046cb97" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "bitflags 2.6.0", "bytes", "http", "http-body", - "http-body-util", "mime", "pin-project-lite", "tower-layer", @@ -2546,7 +2596,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -2749,7 +2799,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", "wasm-bindgen-shared", ] @@ -2771,7 +2821,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2938,7 +2988,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index c149c408..fe6c26da 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,13 +16,13 @@ clap = "4.5" fnv = "1.0" futures = { version = "0.3", features = ["compat"] } indoc = "2.0" -rstest = "0.22" +rstest = "0.23" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" serde_yaml = "0.9" shell-escape = "0.1" snafu = "0.8" -stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.76.0" } +stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.80.0" } product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.7.0" } strum = { version = "0.26", features = ["derive"] } tokio = { version = "1.40", features = ["full"] } diff --git a/Makefile b/Makefile index 248d8533..6f966194 100644 --- a/Makefile +++ b/Makefile @@ -48,9 +48,10 @@ docker-publish: # Uses the keyless signing flow with Github Actions as identity provider\ cosign sign -y "${DOCKER_REPO}/${ORGANIZATION}/${OPERATOR_NAME}@$$REPO_DIGEST_OF_IMAGE";\ # Generate the SBOM for the operator image, this leverages the already generated SBOM for the operator binary by cargo-cyclonedx\ - syft scan --output cyclonedx-json=sbom.json --select-catalogers "-cargo-auditable-binary-cataloger" --scope all-layers --source-name "${OPERATOR_NAME}" --source-version "${VERSION}" "${DOCKER_REPO}/${ORGANIZATION}/${OPERATOR_NAME}@$$REPO_DIGEST_OF_IMAGE";\ + syft scan --output cyclonedx-json=sbom.json --select-catalogers "-cargo-auditable-binary-cataloger" --scope all-layers --source-name "${OPERATOR_NAME}" --source-version "${VERSION}-${ARCH}" "${DOCKER_REPO}/${ORGANIZATION}/${OPERATOR_NAME}@$$REPO_DIGEST_OF_IMAGE";\ # Determine the PURL for the container image\ - PURL="pkg:docker/${ORGANIZATION}/${OPERATOR_NAME}@$$REPO_DIGEST_OF_IMAGE?repository_url=${DOCKER_REPO}";\ + URLENCODED_REPO_DIGEST_OF_IMAGE=$$(echo "$$REPO_DIGEST_OF_IMAGE" | sed 's/:/%3A/g');\ + PURL="pkg:oci/${OPERATOR_NAME}@$$URLENCODED_REPO_DIGEST_OF_IMAGE?arch=${ARCH}&repository_url=${DOCKER_REPO}%2F${ORGANIZATION}%2F${OPERATOR_NAME}";\ # Get metadata from the image\ IMAGE_DESCRIPTION=$$(docker inspect --format='{{.Config.Labels.description}}' "${DOCKER_REPO}/${ORGANIZATION}/${OPERATOR_NAME}:${VERSION}-${ARCH}");\ IMAGE_NAME=$$(docker inspect --format='{{.Config.Labels.name}}' "${DOCKER_REPO}/${ORGANIZATION}/${OPERATOR_NAME}:${VERSION}-${ARCH}");\ @@ -73,9 +74,10 @@ docker-publish: # Uses the keyless signing flow with Github Actions as identity provider\ cosign sign -y "${OCI_REGISTRY_HOSTNAME}/${OCI_REGISTRY_PROJECT_IMAGES}/${OPERATOR_NAME}@$$REPO_DIGEST_OF_IMAGE";\ # Generate the SBOM for the operator image, this leverages the already generated SBOM for the operator binary by cargo-cyclonedx\ - syft scan --output cyclonedx-json=sbom.json --select-catalogers "-cargo-auditable-binary-cataloger" --scope all-layers --source-name "${OPERATOR_NAME}" --source-version "${VERSION}" "${OCI_REGISTRY_HOSTNAME}/${OCI_REGISTRY_PROJECT_IMAGES}/${OPERATOR_NAME}@$$REPO_DIGEST_OF_IMAGE";\ + syft scan --output cyclonedx-json=sbom.json --select-catalogers "-cargo-auditable-binary-cataloger" --scope all-layers --source-name "${OPERATOR_NAME}" --source-version "${VERSION}-${ARCH}" "${OCI_REGISTRY_HOSTNAME}/${OCI_REGISTRY_PROJECT_IMAGES}/${OPERATOR_NAME}@$$REPO_DIGEST_OF_IMAGE";\ # Determine the PURL for the container image\ - PURL="pkg:docker/${OCI_REGISTRY_PROJECT_IMAGES}/${OPERATOR_NAME}@$$REPO_DIGEST_OF_IMAGE?repository_url=${OCI_REGISTRY_HOSTNAME}";\ + URLENCODED_REPO_DIGEST_OF_IMAGE=$$(echo "$$REPO_DIGEST_OF_IMAGE" | sed 's/:/%3A/g');\ + PURL="pkg:oci/${OPERATOR_NAME}@$$URLENCODED_REPO_DIGEST_OF_IMAGE?arch=${ARCH}&repository_url=${OCI_REGISTRY_HOSTNAME}%2F${OCI_REGISTRY_PROJECT_IMAGES}%2F${OPERATOR_NAME}";\ # Get metadata from the image\ IMAGE_DESCRIPTION=$$(docker inspect --format='{{.Config.Labels.description}}' "${OCI_REGISTRY_HOSTNAME}/${OCI_REGISTRY_PROJECT_IMAGES}/${OPERATOR_NAME}:${VERSION}-${ARCH}");\ IMAGE_NAME=$$(docker inspect --format='{{.Config.Labels.name}}' "${OCI_REGISTRY_HOSTNAME}/${OCI_REGISTRY_PROJECT_IMAGES}/${OPERATOR_NAME}:${VERSION}-${ARCH}");\ diff --git a/deploy/helm/hbase-operator/values.yaml b/deploy/helm/hbase-operator/values.yaml index bf423d72..7d14bf15 100644 --- a/deploy/helm/hbase-operator/values.yaml +++ b/deploy/helm/hbase-operator/values.yaml @@ -47,3 +47,7 @@ nodeSelector: {} tolerations: [] affinity: {} + +# When running on a non-default Kubernetes cluster domain, the cluster domain can be configured here. +# See the https://docs.stackable.tech/home/stable/guides/kubernetes-cluster-domain guide for details. +# kubernetesClusterDomain: my-cluster.local diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 23142f76..d587e661 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ # DO NOT EDIT, this file is generated by operator-templating [toolchain] -channel = "1.80.1" +channel = "1.81.0" diff --git a/rust/operator-binary/src/discovery.rs b/rust/operator-binary/src/discovery.rs index c3dac370..f5c9e8a4 100644 --- a/rust/operator-binary/src/discovery.rs +++ b/rust/operator-binary/src/discovery.rs @@ -8,6 +8,7 @@ use stackable_operator::{ commons::product_image_selection::ResolvedProductImage, k8s_openapi::api::core::v1::ConfigMap, kube::runtime::reflector::ObjectRef, + utils::cluster_info::KubernetesClusterInfo, }; use crate::{ @@ -43,12 +44,15 @@ pub enum Error { /// Creates a discovery config map containing the `hbase-site.xml` for clients. pub fn build_discovery_configmap( hbase: &HbaseCluster, + cluster_info: &KubernetesClusterInfo, zookeeper_connection_information: &ZookeeperConnectionInformation, resolved_product_image: &ResolvedProductImage, ) -> Result { let mut hbase_site = zookeeper_connection_information.as_hbase_settings(); - hbase_site - .extend(kerberos_discovery_config_properties(hbase).context(AddKerberosDiscoverySnafu)?); + hbase_site.extend( + kerberos_discovery_config_properties(hbase, cluster_info) + .context(AddKerberosDiscoverySnafu)?, + ); ConfigMapBuilder::new() .metadata( diff --git a/rust/operator-binary/src/hbase_controller.rs b/rust/operator-binary/src/hbase_controller.rs index c98646bf..d9c6e565 100644 --- a/rust/operator-binary/src/hbase_controller.rs +++ b/rust/operator-binary/src/hbase_controller.rs @@ -7,6 +7,7 @@ use product_config::{ use snafu::{OptionExt, ResultExt, Snafu}; use stackable_operator::{ builder::{ + self, configmap::ConfigMapBuilder, meta::ObjectMetaBuilder, pod::{ @@ -37,6 +38,7 @@ use stackable_operator::{ product_config_utils::{transform_all_roles_to_config, validate_all_roles_and_groups_config}, product_logging::{ self, + framework::LoggingError, spec::{ ConfigMapLogConfig, ContainerLogConfig, ContainerLogConfigChoice, CustomContainerLogConfig, @@ -48,6 +50,7 @@ use stackable_operator::{ statefulset::StatefulSetConditionBuilder, }, time::Duration, + utils::cluster_info::KubernetesClusterInfo, }; use std::{ collections::{BTreeMap, HashMap}, @@ -282,6 +285,17 @@ pub enum Error { #[snafu(display("authorization is only supported from HBase 2.6 onwards"))] AuthorizationNotSupported, + #[snafu(display("failed to configure logging"))] + ConfigureLogging { source: LoggingError }, + + #[snafu(display("failed to add needed volume"))] + AddVolume { source: builder::pod::Error }, + + #[snafu(display("failed to add needed volumeMount"))] + AddVolumeMount { + source: builder::pod::container::Error, + }, + #[snafu(display("HBaseCluster object is invalid"))] InvalidHBaseCluster { source: error_boundary::InvalidObject, @@ -363,6 +377,7 @@ pub async fn reconcile_hbase( // discovery config map let discovery_cm = build_discovery_configmap( hbase, + &client.kubernetes_cluster_info, &zookeeper_connection_information, &resolved_product_image, ) @@ -410,6 +425,7 @@ pub async fn reconcile_hbase( build_rolegroup_service(hbase, &hbase_role, &rolegroup, &resolved_product_image)?; let rg_configmap = build_rolegroup_config_map( hbase, + &client.kubernetes_cluster_info, &rolegroup, rolegroup_config, &zookeeper_connection_information, @@ -535,6 +551,7 @@ pub fn build_region_server_role_service( #[allow(clippy::too_many_arguments)] fn build_rolegroup_config_map( hbase: &HbaseCluster, + cluster_info: &KubernetesClusterInfo, rolegroup: &RoleGroupRef, rolegroup_config: &HashMap>, zookeeper_connection_information: &ZookeeperConnectionInformation, @@ -558,8 +575,10 @@ fn build_rolegroup_config_map( PropertyNameKind::File(file_name) if file_name == HBASE_SITE_XML => { let mut hbase_site_config = BTreeMap::new(); hbase_site_config.extend(zookeeper_connection_information.as_hbase_settings()); - hbase_site_config - .extend(kerberos_config_properties(hbase).context(AddKerberosConfigSnafu)?); + hbase_site_config.extend( + kerberos_config_properties(hbase, cluster_info) + .context(AddKerberosConfigSnafu)?, + ); hbase_site_config .extend(hbase_opa_config.map_or(vec![], |config| config.hbase_site_config())); @@ -850,9 +869,13 @@ fn build_rolegroup_statefulset( ]) .add_env_vars(merged_env) .add_volume_mount("hbase-config", HBASE_CONFIG_TMP_DIR) + .context(AddVolumeMountSnafu)? .add_volume_mount("hdfs-discovery", HDFS_DISCOVERY_TMP_DIR) + .context(AddVolumeMountSnafu)? .add_volume_mount("log-config", HBASE_LOG_CONFIG_TMP_DIR) + .context(AddVolumeMountSnafu)? .add_volume_mount("log", STACKABLE_LOG_DIR) + .context(AddVolumeMountSnafu)? .add_container_ports(ports) .resources(config.resources().clone().into()) .startup_probe(startup_probe) @@ -883,6 +906,7 @@ fn build_rolegroup_statefulset( }), ..Default::default() }) + .context(AddVolumeSnafu)? .add_volume(stackable_operator::k8s_openapi::api::core::v1::Volume { name: "hdfs-discovery".to_string(), config_map: Some(ConfigMapVolumeSource { @@ -891,12 +915,14 @@ fn build_rolegroup_statefulset( }), ..Default::default() }) + .context(AddVolumeSnafu)? .add_empty_dir_volume( "log", Some(product_logging::framework::calculate_log_volume_size_limit( &[MAX_HBASE_LOG_FILES_SIZE], )), ) + .context(AddVolumeSnafu)? .service_account_name(service_account_name(APP_NAME)) .security_context( PodSecurityContextBuilder::new() @@ -913,23 +939,27 @@ fn build_rolegroup_statefulset( })), }) = config.logging().containers.get(&Container::Hbase) { - pod_builder.add_volume(Volume { - name: "log-config".to_string(), - config_map: Some(ConfigMapVolumeSource { - name: config_map.into(), - ..ConfigMapVolumeSource::default() - }), - ..Volume::default() - }); + pod_builder + .add_volume(Volume { + name: "log-config".to_string(), + config_map: Some(ConfigMapVolumeSource { + name: config_map.into(), + ..ConfigMapVolumeSource::default() + }), + ..Volume::default() + }) + .context(AddVolumeSnafu)?; } else { - pod_builder.add_volume(Volume { - name: "log-config".to_string(), - config_map: Some(ConfigMapVolumeSource { - name: rolegroup_ref.object_name(), - ..ConfigMapVolumeSource::default() - }), - ..Volume::default() - }); + pod_builder + .add_volume(Volume { + name: "log-config".to_string(), + config_map: Some(ConfigMapVolumeSource { + name: rolegroup_ref.object_name(), + ..ConfigMapVolumeSource::default() + }), + ..Volume::default() + }) + .context(AddVolumeSnafu)?; } add_graceful_shutdown_config(config, &mut pod_builder).context(GracefulShutdownSnafu)?; @@ -941,18 +971,21 @@ fn build_rolegroup_statefulset( // Vector sidecar shall be the last container in the list if config.logging().enable_vector_agent { - pod_builder.add_container(product_logging::framework::vector_container( - resolved_product_image, - "hbase-config", - "log", - config.logging().containers.get(&Container::Vector), - ResourceRequirementsBuilder::new() - .with_cpu_request("250m") - .with_cpu_limit("500m") - .with_memory_request("128Mi") - .with_memory_limit("128Mi") - .build(), - )); + pod_builder.add_container( + product_logging::framework::vector_container( + resolved_product_image, + "hbase-config", + "log", + config.logging().containers.get(&Container::Vector), + ResourceRequirementsBuilder::new() + .with_cpu_request("250m") + .with_cpu_limit("500m") + .with_memory_request("128Mi") + .with_memory_limit("128Mi") + .build(), + ) + .context(ConfigureLoggingSnafu)?, + ); } let mut pod_template = pod_builder.build_template(); diff --git a/rust/operator-binary/src/kerberos.rs b/rust/operator-binary/src/kerberos.rs index 4e4b8550..c81e261f 100644 --- a/rust/operator-binary/src/kerberos.rs +++ b/rust/operator-binary/src/kerberos.rs @@ -3,12 +3,16 @@ use std::collections::BTreeMap; use snafu::{OptionExt, ResultExt, Snafu}; use stackable_hbase_crd::{HbaseCluster, TLS_STORE_DIR, TLS_STORE_PASSWORD, TLS_STORE_VOLUME_NAME}; use stackable_operator::{ - builder::pod::{ - container::ContainerBuilder, - volume::{SecretFormat, SecretOperatorVolumeSourceBuilder, VolumeBuilder}, - PodBuilder, + builder::{ + self, + pod::{ + container::ContainerBuilder, + volume::{SecretFormat, SecretOperatorVolumeSourceBuilder, VolumeBuilder}, + PodBuilder, + }, }, kube::{runtime::reflector::ObjectRef, ResourceExt}, + utils::cluster_info::KubernetesClusterInfo, }; #[derive(Snafu, Debug)] @@ -25,14 +29,25 @@ pub enum Error { AddTlsSecretVolume { source: stackable_operator::builder::pod::volume::SecretOperatorVolumeSourceBuilderError, }, + + #[snafu(display("failed to add needed volume"))] + AddVolume { source: builder::pod::Error }, + + #[snafu(display("failed to add needed volumeMount"))] + AddVolumeMount { + source: builder::pod::container::Error, + }, } -pub fn kerberos_config_properties(hbase: &HbaseCluster) -> Result, Error> { +pub fn kerberos_config_properties( + hbase: &HbaseCluster, + cluster_info: &KubernetesClusterInfo, +) -> Result, Error> { if !hbase.has_kerberos_enabled() { return Ok(BTreeMap::new()); } - let principal_host_part = principal_host_part(hbase)?; + let principal_host_part = principal_host_part(hbase, cluster_info)?; Ok(BTreeMap::from([ // Kerberos settings @@ -119,12 +134,13 @@ pub fn kerberos_config_properties(hbase: &HbaseCluster) -> Result Result, Error> { if !hbase.has_kerberos_enabled() { return Ok(BTreeMap::new()); } - let principal_host_part = principal_host_part(hbase)?; + let principal_host_part = principal_host_part(hbase, cluster_info)?; Ok(BTreeMap::from([ ( @@ -226,8 +242,10 @@ pub fn add_kerberos_pod_config( VolumeBuilder::new("kerberos") .ephemeral(kerberos_secret_operator_volume) .build(), - ); - cb.add_volume_mount("kerberos", "/stackable/kerberos"); + ) + .context(AddVolumeSnafu)?; + cb.add_volume_mount("kerberos", "/stackable/kerberos") + .context(AddVolumeMountSnafu)?; // Needed env vars cb.add_env_var("KRB5_CONFIG", "/stackable/kerberos/krb5.conf"); @@ -252,19 +270,25 @@ pub fn add_kerberos_pod_config( .context(AddTlsSecretVolumeSnafu)?, ) .build(), - ); - cb.add_volume_mount(TLS_STORE_VOLUME_NAME, TLS_STORE_DIR); + ) + .context(AddVolumeSnafu)?; + cb.add_volume_mount(TLS_STORE_VOLUME_NAME, TLS_STORE_DIR) + .context(AddVolumeMountSnafu)?; } Ok(()) } -fn principal_host_part(hbase: &HbaseCluster) -> Result { +fn principal_host_part( + hbase: &HbaseCluster, + cluster_info: &KubernetesClusterInfo, +) -> Result { let hbase_name = hbase.name_any(); let hbase_namespace = hbase.namespace().context(ObjectMissingNamespaceSnafu { hbase: ObjectRef::from_obj(hbase), })?; + let cluster_domain = &cluster_info.cluster_domain; Ok(format!( - "{hbase_name}.{hbase_namespace}.svc.cluster.local@${{env.KERBEROS_REALM}}" + "{hbase_name}.{hbase_namespace}.svc.{cluster_domain}@${{env.KERBEROS_REALM}}" )) } diff --git a/rust/operator-binary/src/main.rs b/rust/operator-binary/src/main.rs index a762b17e..ae00a15a 100644 --- a/rust/operator-binary/src/main.rs +++ b/rust/operator-binary/src/main.rs @@ -45,6 +45,7 @@ async fn main() -> anyhow::Result<()> { product_config, watch_namespace, tracing_target, + cluster_info_opts, }) => { stackable_operator::logging::initialize_logging( "HBASE_OPERATOR_LOG", @@ -63,8 +64,11 @@ async fn main() -> anyhow::Result<()> { "deploy/config-spec/properties.yaml", "/etc/stackable/hbase-operator/config-spec/properties.yaml", ])?; - let client = - stackable_operator::client::create_client(Some(OPERATOR_NAME.to_string())).await?; + let client = stackable_operator::client::initialize_operator( + Some(OPERATOR_NAME.to_string()), + &cluster_info_opts, + ) + .await?; Controller::new( watch_namespace.get_api::>(&client),