From c60ff603cbce5b14d7a76cfbcd075102c09cabcf Mon Sep 17 00:00:00 2001 From: Techassi Date: Wed, 4 Feb 2026 16:19:50 +0100 Subject: [PATCH 1/5] feat: Add graceful shutdown --- Cargo.lock | 16 ++++++++-------- Cargo.nix | 30 +++++++++++++++--------------- Cargo.toml | 2 +- crate-hashes.json | 14 +++++++------- rust/operator-binary/src/main.rs | 9 +++++++-- 5 files changed, 38 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index da25325c..19f344ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1387,7 +1387,7 @@ dependencies = [ [[package]] name = "k8s-version" version = "0.1.3" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#402911782469fd689308f3e57c38ad249dec83f3" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.105.0#7bfcac5f6515c8b4c8cf8def2edfde5ed8621aaa" dependencies = [ "darling 0.23.0", "regex", @@ -2538,8 +2538,8 @@ checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "stackable-operator" -version = "0.102.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#402911782469fd689308f3e57c38ad249dec83f3" +version = "0.105.0" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.105.0#7bfcac5f6515c8b4c8cf8def2edfde5ed8621aaa" dependencies = [ "chrono", "clap", @@ -2577,7 +2577,7 @@ dependencies = [ [[package]] name = "stackable-operator-derive" version = "0.3.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#402911782469fd689308f3e57c38ad249dec83f3" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.105.0#7bfcac5f6515c8b4c8cf8def2edfde5ed8621aaa" dependencies = [ "darling 0.23.0", "proc-macro2", @@ -2588,7 +2588,7 @@ dependencies = [ [[package]] name = "stackable-shared" version = "0.0.3" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#402911782469fd689308f3e57c38ad249dec83f3" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.105.0#7bfcac5f6515c8b4c8cf8def2edfde5ed8621aaa" dependencies = [ "chrono", "k8s-openapi", @@ -2605,7 +2605,7 @@ dependencies = [ [[package]] name = "stackable-telemetry" version = "0.6.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#402911782469fd689308f3e57c38ad249dec83f3" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.105.0#7bfcac5f6515c8b4c8cf8def2edfde5ed8621aaa" dependencies = [ "axum", "clap", @@ -2654,7 +2654,7 @@ dependencies = [ [[package]] name = "stackable-versioned" version = "0.8.3" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#402911782469fd689308f3e57c38ad249dec83f3" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.105.0#7bfcac5f6515c8b4c8cf8def2edfde5ed8621aaa" dependencies = [ "schemars", "serde", @@ -2667,7 +2667,7 @@ dependencies = [ [[package]] name = "stackable-versioned-macros" version = "0.8.3" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#402911782469fd689308f3e57c38ad249dec83f3" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.105.0#7bfcac5f6515c8b4c8cf8def2edfde5ed8621aaa" dependencies = [ "convert_case", "darling 0.23.0", diff --git a/Cargo.nix b/Cargo.nix index f00b97cf..d78f4397 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -4303,8 +4303,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "402911782469fd689308f3e57c38ad249dec83f3"; - sha256 = "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy"; + rev = "7bfcac5f6515c8b4c8cf8def2edfde5ed8621aaa"; + sha256 = "02z7c2kjhcwg153j74n52wwcr5x0z70hc21hlsrxyclmc8ps1lmd"; }; libName = "k8s_version"; authors = [ @@ -8234,13 +8234,13 @@ rec { }; "stackable-operator" = rec { crateName = "stackable-operator"; - version = "0.102.0"; + version = "0.105.0"; edition = "2024"; workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "402911782469fd689308f3e57c38ad249dec83f3"; - sha256 = "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy"; + rev = "7bfcac5f6515c8b4c8cf8def2edfde5ed8621aaa"; + sha256 = "02z7c2kjhcwg153j74n52wwcr5x0z70hc21hlsrxyclmc8ps1lmd"; }; libName = "stackable_operator"; authors = [ @@ -8408,8 +8408,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "402911782469fd689308f3e57c38ad249dec83f3"; - sha256 = "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy"; + rev = "7bfcac5f6515c8b4c8cf8def2edfde5ed8621aaa"; + sha256 = "02z7c2kjhcwg153j74n52wwcr5x0z70hc21hlsrxyclmc8ps1lmd"; }; procMacro = true; libName = "stackable_operator_derive"; @@ -8443,8 +8443,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "402911782469fd689308f3e57c38ad249dec83f3"; - sha256 = "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy"; + rev = "7bfcac5f6515c8b4c8cf8def2edfde5ed8621aaa"; + sha256 = "02z7c2kjhcwg153j74n52wwcr5x0z70hc21hlsrxyclmc8ps1lmd"; }; libName = "stackable_shared"; authors = [ @@ -8525,8 +8525,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "402911782469fd689308f3e57c38ad249dec83f3"; - sha256 = "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy"; + rev = "7bfcac5f6515c8b4c8cf8def2edfde5ed8621aaa"; + sha256 = "02z7c2kjhcwg153j74n52wwcr5x0z70hc21hlsrxyclmc8ps1lmd"; }; libName = "stackable_telemetry"; authors = [ @@ -8744,8 +8744,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "402911782469fd689308f3e57c38ad249dec83f3"; - sha256 = "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy"; + rev = "7bfcac5f6515c8b4c8cf8def2edfde5ed8621aaa"; + sha256 = "02z7c2kjhcwg153j74n52wwcr5x0z70hc21hlsrxyclmc8ps1lmd"; }; libName = "stackable_versioned"; authors = [ @@ -8788,8 +8788,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "402911782469fd689308f3e57c38ad249dec83f3"; - sha256 = "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy"; + rev = "7bfcac5f6515c8b4c8cf8def2edfde5ed8621aaa"; + sha256 = "02z7c2kjhcwg153j74n52wwcr5x0z70hc21hlsrxyclmc8ps1lmd"; }; procMacro = true; libName = "stackable_versioned_macros"; diff --git a/Cargo.toml b/Cargo.toml index 0dfd17de..5e56be8e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ repository = "https://github.com/stackabletech/trino-operator" [workspace.dependencies] product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.8.0" } -stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.102.0", features = ["telemetry", "versioned"] } +stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.105.0", features = ["telemetry", "versioned"] } anyhow = "1.0" async-trait = "0.1" diff --git a/crate-hashes.json b/crate-hashes.json index 68215a44..c7bba396 100644 --- a/crate-hashes.json +++ b/crate-hashes.json @@ -4,12 +4,12 @@ "git+https://github.com/stackabletech/kube-rs?branch=2.0.1-fix-schema-hoisting#kube-derive@2.0.1": "1a7bcl0w1jg71jc4iml0vjp8dpzy71mhxl012grxcy2xp5i6xvgf", "git+https://github.com/stackabletech/kube-rs?branch=2.0.1-fix-schema-hoisting#kube-runtime@2.0.1": "1a7bcl0w1jg71jc4iml0vjp8dpzy71mhxl012grxcy2xp5i6xvgf", "git+https://github.com/stackabletech/kube-rs?branch=2.0.1-fix-schema-hoisting#kube@2.0.1": "1a7bcl0w1jg71jc4iml0vjp8dpzy71mhxl012grxcy2xp5i6xvgf", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#k8s-version@0.1.3": "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#stackable-operator-derive@0.3.1": "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#stackable-operator@0.102.0": "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#stackable-shared@0.0.3": "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#stackable-telemetry@0.6.1": "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#stackable-versioned-macros@0.8.3": "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#stackable-versioned@0.8.3": "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.105.0#k8s-version@0.1.3": "02z7c2kjhcwg153j74n52wwcr5x0z70hc21hlsrxyclmc8ps1lmd", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.105.0#stackable-operator-derive@0.3.1": "02z7c2kjhcwg153j74n52wwcr5x0z70hc21hlsrxyclmc8ps1lmd", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.105.0#stackable-operator@0.105.0": "02z7c2kjhcwg153j74n52wwcr5x0z70hc21hlsrxyclmc8ps1lmd", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.105.0#stackable-shared@0.0.3": "02z7c2kjhcwg153j74n52wwcr5x0z70hc21hlsrxyclmc8ps1lmd", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.105.0#stackable-telemetry@0.6.1": "02z7c2kjhcwg153j74n52wwcr5x0z70hc21hlsrxyclmc8ps1lmd", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.105.0#stackable-versioned-macros@0.8.3": "02z7c2kjhcwg153j74n52wwcr5x0z70hc21hlsrxyclmc8ps1lmd", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.105.0#stackable-versioned@0.8.3": "02z7c2kjhcwg153j74n52wwcr5x0z70hc21hlsrxyclmc8ps1lmd", "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/main.rs b/rust/operator-binary/src/main.rs index 4f1536fa..3a4037d8 100644 --- a/rust/operator-binary/src/main.rs +++ b/rust/operator-binary/src/main.rs @@ -39,6 +39,7 @@ use stackable_operator::{ logging::controller::report_controller_reconciled, shared::yaml::SerializeOptions, telemetry::Tracing, + utils::signal::SignalWatcher, }; use crate::{ @@ -95,9 +96,13 @@ async fn main() -> anyhow::Result<()> { description = built_info::PKG_DESCRIPTION ); + // Watches for the SIGTERM signal and sends a signal to all receivers, which gracefully + // shuts down all concurrent tasks below (EoS checker, controller). + let sigterm_watcher = SignalWatcher::sigterm()?; + let eos_checker = EndOfSupportChecker::new(built_info::BUILT_TIME_UTC, maintenance.end_of_support)? - .run() + .run(sigterm_watcher.handle()) .map(anyhow::Ok); let product_config = product_config.load(&[ @@ -139,7 +144,6 @@ async fn main() -> anyhow::Result<()> { watch_namespace.get_api::>(&client), watcher::Config::default(), ) - .shutdown_on_signal() .watches( watch_namespace .get_api::>(&client), @@ -178,6 +182,7 @@ async fn main() -> anyhow::Result<()> { .map(|druid| ObjectRef::from_obj(&*druid)) }, ) + .graceful_shutdown_on(sigterm_watcher.handle()) .run( controller::reconcile_trino, controller::error_policy, From 2555d286d8c04bd0e417e6faaa65d310c07479fb Mon Sep 17 00:00:00 2001 From: Techassi Date: Wed, 4 Feb 2026 16:20:07 +0100 Subject: [PATCH 2/5] chore: Update CRD documentation --- deploy/helm/trino-operator/crds/crds.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deploy/helm/trino-operator/crds/crds.yaml b/deploy/helm/trino-operator/crds/crds.yaml index 236906aa..7a99a5b4 100644 --- a/deploy/helm/trino-operator/crds/crds.yaml +++ b/deploy/helm/trino-operator/crds/crds.yaml @@ -1224,7 +1224,7 @@ spec: default: {} description: |- In the `podOverrides` property you can define a - [PodTemplateSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#podtemplatespec-v1-core) + [PodTemplateSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#podtemplatespec-v1-core) to override any property that can be set on a Kubernetes Pod. Read the [Pod overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#pod-overrides) @@ -1540,7 +1540,7 @@ spec: default: {} description: |- In the `podOverrides` property you can define a - [PodTemplateSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#podtemplatespec-v1-core) + [PodTemplateSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#podtemplatespec-v1-core) to override any property that can be set on a Kubernetes Pod. Read the [Pod overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#pod-overrides) @@ -1901,7 +1901,7 @@ spec: default: {} description: |- In the `podOverrides` property you can define a - [PodTemplateSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#podtemplatespec-v1-core) + [PodTemplateSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#podtemplatespec-v1-core) to override any property that can be set on a Kubernetes Pod. Read the [Pod overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#pod-overrides) @@ -2212,7 +2212,7 @@ spec: default: {} description: |- In the `podOverrides` property you can define a - [PodTemplateSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#podtemplatespec-v1-core) + [PodTemplateSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#podtemplatespec-v1-core) to override any property that can be set on a Kubernetes Pod. Read the [Pod overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#pod-overrides) From 8284d2d840bf2d66504b5add59fcc7763daa821c Mon Sep 17 00:00:00 2001 From: Techassi Date: Wed, 4 Feb 2026 16:20:30 +0100 Subject: [PATCH 3/5] chore: Bump bytes crate to 1.11.1 Fixes RUSTSEC-2026-0007. --- Cargo.lock | 4 ++-- Cargo.nix | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 19f344ed..5e92757c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -275,9 +275,9 @@ checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" [[package]] name = "bytes" -version = "1.10.1" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" [[package]] name = "cc" diff --git a/Cargo.nix b/Cargo.nix index d78f4397..f1bdc8b1 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -896,9 +896,9 @@ rec { }; "bytes" = rec { crateName = "bytes"; - version = "1.10.1"; - edition = "2018"; - sha256 = "0smd4wi2yrhp5pmq571yiaqx84bjqlm1ixqhnvfwzzc6pqkn26yp"; + version = "1.11.1"; + edition = "2021"; + sha256 = "0czwlhbq8z29wq0ia87yass2mzy1y0jcasjb8ghriiybnwrqfx0y"; authors = [ "Carl Lerche " "Sean McArthur " From da6f50e378324ef5c7db5cac04b3d171836d91f9 Mon Sep 17 00:00:00 2001 From: Techassi Date: Wed, 4 Feb 2026 16:21:00 +0100 Subject: [PATCH 4/5] chore: Bump giz2 crate to 0.20.4 Fixes RUSTSEC-2026-0008. --- Cargo.lock | 8 ++++---- Cargo.nix | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5e92757c..ea59b8d4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -897,9 +897,9 @@ dependencies = [ [[package]] name = "git2" -version = "0.20.2" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2deb07a133b1520dc1a5690e9bd08950108873d7ed5de38dcc74d3b5ebffa110" +checksum = "7b88256088d75a56f8ecfa070513a775dd9107f6530ef14919dac831af9cfe2b" dependencies = [ "bitflags", "libc", @@ -1512,9 +1512,9 @@ checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" [[package]] name = "libgit2-sys" -version = "0.18.2+1.9.1" +version = "0.18.3+1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c42fe03df2bd3c53a3a9c7317ad91d80c81cd1fb0caec8d7cc4cd2bfa10c222" +checksum = "c9b3acc4b91781bb0b3386669d325163746af5f6e4f73e6d2d630e09a35f3487" dependencies = [ "cc", "libc", diff --git a/Cargo.nix b/Cargo.nix index f1bdc8b1..0ac3f347 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -2706,9 +2706,9 @@ rec { }; "git2" = rec { crateName = "git2"; - version = "0.20.2"; + version = "0.20.4"; edition = "2018"; - sha256 = "0451zzmvblvlrj6y6pgdsxrqh42hi789n3k9lp0hslmi6fhhgsrd"; + sha256 = "0azykjpk3j6s354z23jkyq3r3pbmlw9ha1zsxkw5cnnpi1h2b23v"; authors = [ "Josh Triplett " "Alex Crichton " @@ -4943,10 +4943,10 @@ rec { }; "libgit2-sys" = rec { crateName = "libgit2-sys"; - version = "0.18.2+1.9.1"; - edition = "2018"; + version = "0.18.3+1.9.2"; + edition = "2021"; links = "git2"; - sha256 = "08n223x2pkf4gj6yrjmh3z6q236qj6nifwww78xcblrbvw1zwhhw"; + sha256 = "11rlbyihj3k35mnkxxz4yvsnlx33a4r9srl66c5vp08pp72arcy9"; libName = "libgit2_sys"; libPath = "lib.rs"; authors = [ From bf0610663713f30b115045bd124b9c50cabc2deb Mon Sep 17 00:00:00 2001 From: Techassi Date: Wed, 4 Feb 2026 16:23:45 +0100 Subject: [PATCH 5/5] chore: Add changelog entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b234e4f..043a7f71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file. ### Changed +- Gracefully shutdown all concurrent tasks by forwarding the SIGTERM signal ([#843]). - Pin k8s-openapi to `0.26.0` ([#831]). - BREAKING: The field `opa` in `authorization` is now a mandatory enum variant instead of being optional ([#827]). - BREAKING: The operator no longer sets `opa.policy.column-masking-uri` in `access-control.properties` but @@ -31,6 +32,7 @@ All notable changes to this project will be documented in this file. [#833]: https://github.com/stackabletech/trino-operator/pull/833 [#839]: https://github.com/stackabletech/trino-operator/pull/839 [#841]: https://github.com/stackabletech/trino-operator/pull/841 +[#843]: https://github.com/stackabletech/trino-operator/pull/843 ## [25.11.0] - 2025-11-07