Skip to content

Commit ce1931c

Browse files
authored
feat: Add graceful shutdown (#894)
* feat: Add graceful shutdown * chore: Update CRD documentation * chore: Bump bytes crate to 1.11.1 Fixes RUSTSEC-2026-0007. * chore: Add changelog entry
1 parent 8d3c193 commit ce1931c

File tree

7 files changed

+53
-53
lines changed

7 files changed

+53
-53
lines changed

CHANGELOG.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@ All notable changes to this project will be documented in this file.
1111
- Enable the [restart-controller](https://docs.stackable.tech/home/nightly/commons-operator/restarter/), so that the Pods are automatically restarted on config changes ([#888]).
1212
- Added support for `2.7.2` ([#893]).
1313

14-
### Removed
15-
16-
- Removed support for `1.27.0` and `2.4.0` ([#893]).
17-
1814
### Changed
1915

16+
- Gracefully shutdown all concurrent tasks by forwarding the SIGTERM signal ([#894]).
2017
- BREAKING: Reworked authorization config to closer match the Apache NiFi internal authorizer interfaces ([#884]).
2118

2219
### Fixed
@@ -25,12 +22,17 @@ All notable changes to this project will be documented in this file.
2522
- The operator now utilizes the `.spec.clusterConfig.authorization.opa.package` property instead of hard-coding the package name to `nifi` ([#881]).
2623
- An `initialAdminUser` can now be provided for file-based authorization (e.g. LDAP) ([#884]).
2724

25+
### Removed
26+
27+
- Removed support for `1.27.0` and `2.4.0` ([#893]).
28+
2829
[#870]: https://github.com/stackabletech/nifi-operator/pull/870
2930
[#881]: https://github.com/stackabletech/nifi-operator/pull/881
3031
[#884]: https://github.com/stackabletech/nifi-operator/pull/884
3132
[#885]: https://github.com/stackabletech/nifi-operator/pull/885
3233
[#888]: https://github.com/stackabletech/nifi-operator/pull/888
3334
[#893]: https://github.com/stackabletech/nifi-operator/pull/893
35+
[#894]: https://github.com/stackabletech/nifi-operator/pull/894
3436

3537
## [25.11.0] - 2025-11-07
3638

Cargo.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.nix

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repository = "https://github.com/stackabletech/nifi-operator"
1111

1212
[workspace.dependencies]
1313
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.8.0" }
14-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.102.0", features = ["telemetry", "versioned"] }
14+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.105.0", features = ["telemetry", "versioned"] }
1515

1616
anyhow = "1.0"
1717
built = { version = "0.8", features = ["chrono", "git2"] }

crate-hashes.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deploy/helm/nifi-operator/crds/crds.yaml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,7 @@ spec:
184184
Since git-sync v4.x.x this field is mapped to the flag `--ref`.
185185
type: string
186186
credentialsSecret:
187-
description: |-
188-
The name of the Secret used to access the repository if it is not public.
189-
190-
The referenced Secret must include two fields: `user` and `password`.
191-
The `password` field can either be an actual password (not recommended) or a GitHub token,
192-
as described in the git-sync [documentation].
193-
194-
[documentation]: https://github.com/kubernetes/git-sync/tree/v4.2.4?tab=readme-ov-file#manual
187+
description: An optional secret used for git access.
195188
nullable: true
196189
type: string
197190
depth:
@@ -221,7 +214,7 @@ spec:
221214
[example]: https://docs.stackable.tech/home/nightly/airflow/usage-guide/mounting-dags#_example
222215
type: object
223216
repo:
224-
description: 'The git repository URL that will be cloned, for example: `https://github.com/stackabletech/airflow-operator`.'
217+
description: 'The git repository URL that will be cloned, for example: `https://github.com/stackabletech/airflow-operator` or `ssh://git@github.com:stackable-airflow/dags.git`.'
225218
format: uri
226219
type: string
227220
wait:
@@ -996,7 +989,7 @@ spec:
996989
default: {}
997990
description: |-
998991
In the `podOverrides` property you can define a
999-
[PodTemplateSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#podtemplatespec-v1-core)
992+
[PodTemplateSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#podtemplatespec-v1-core)
1000993
to override any property that can be set on a Kubernetes Pod.
1001994
Read the
1002995
[Pod overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#pod-overrides)
@@ -1596,7 +1589,7 @@ spec:
15961589
default: {}
15971590
description: |-
15981591
In the `podOverrides` property you can define a
1599-
[PodTemplateSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#podtemplatespec-v1-core)
1592+
[PodTemplateSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#podtemplatespec-v1-core)
16001593
to override any property that can be set on a Kubernetes Pod.
16011594
Read the
16021595
[Pod overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#pod-overrides)

rust/operator-binary/src/main.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ use stackable_operator::{
2828
logging::controller::report_controller_reconciled,
2929
shared::yaml::SerializeOptions,
3030
telemetry::Tracing,
31+
utils::signal::SignalWatcher,
3132
};
3233

3334
use crate::{
@@ -88,9 +89,13 @@ async fn main() -> anyhow::Result<()> {
8889
description = built_info::PKG_DESCRIPTION
8990
);
9091

92+
// Watches for the SIGTERM signal and sends a signal to all receivers, which gracefully
93+
// shuts down all concurrent tasks below (EoS checker, controller).
94+
let sigterm_watcher = SignalWatcher::sigterm()?;
95+
9196
let eos_checker =
9297
EndOfSupportChecker::new(built_info::BUILT_TIME_UTC, maintenance.end_of_support)?
93-
.run()
98+
.run(sigterm_watcher.handle())
9499
.map(anyhow::Ok);
95100

96101
let product_config = product_config.load(&[
@@ -133,7 +138,6 @@ async fn main() -> anyhow::Result<()> {
133138
watch_namespace.get_api::<ConfigMap>(&client),
134139
watcher::Config::default(),
135140
)
136-
.shutdown_on_signal()
137141
.watches(
138142
client
139143
.get_api::<DeserializeGuard<auth_core::v1alpha1::AuthenticationClass>>(&()),
@@ -156,6 +160,7 @@ async fn main() -> anyhow::Result<()> {
156160
.map(|nifi| ObjectRef::from_obj(&*nifi))
157161
},
158162
)
163+
.graceful_shutdown_on(sigterm_watcher.handle())
159164
.run(
160165
controller::reconcile_nifi,
161166
controller::error_policy,

0 commit comments

Comments
 (0)