diff --git a/crates/stackable-operator/CHANGELOG.md b/crates/stackable-operator/CHANGELOG.md index d0d385dd4..812b4a695 100644 --- a/crates/stackable-operator/CHANGELOG.md +++ b/crates/stackable-operator/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file. ### Added +- Add CLI argument and env var to disable the end-of-support checker: `EOS_DISABLED` (`--eos-disabled`) ([#1101]). - Add end-of-support checker ([#1096]). - The EoS checker can be constructed using `EndOfSupportChecker::new()`. - Add new `MaintenanceOptions` and `EndOfSupportOptions` structs. @@ -24,6 +25,7 @@ All notable changes to this project will be documented in this file. [#1096]: https://github.com/stackabletech/operator-rs/pull/1096 [#1098]: https://github.com/stackabletech/operator-rs/pull/1098 +[#1101]: https://github.com/stackabletech/operator-rs/pull/1101 ## [0.98.0] - 2025-09-22 diff --git a/crates/stackable-operator/src/eos/mod.rs b/crates/stackable-operator/src/eos/mod.rs index bb246ca0f..3a92da7b9 100644 --- a/crates/stackable-operator/src/eos/mod.rs +++ b/crates/stackable-operator/src/eos/mod.rs @@ -27,6 +27,10 @@ pub struct EndOfSupportOptions { ))] pub interval: Duration, + /// If the end-of-support check should be disabled entirely. + #[cfg_attr(feature = "clap", arg(long = "eos-disabled", env = "EOS_DISABLED"))] + pub disabled: bool, + /// The support duration (how long the operator should be considered supported after /// it's built-date). /// @@ -65,6 +69,7 @@ pub enum Error { pub struct EndOfSupportChecker { datetime: DateTime, interval: Duration, + disabled: bool, } impl EndOfSupportChecker { @@ -79,6 +84,7 @@ impl EndOfSupportChecker { let EndOfSupportOptions { interval, support_duration, + disabled, .. } = options; @@ -95,7 +101,11 @@ impl EndOfSupportChecker { // Add the support duration to the built date. This marks the end-of-support date. datetime += *support_duration; - Ok(Self { datetime, interval }) + Ok(Self { + datetime, + interval, + disabled, + }) } /// Run the end-of-support checker. @@ -103,6 +113,11 @@ impl EndOfSupportChecker { /// It is recommended to run the end-of-support checker via [`futures::try_join!`] or /// [`tokio::join`] alongside other futures (eg. for controllers). pub async fn run(self) { + // Immediately return if the end-of-support checker is disabled. + if self.disabled { + return; + } + // Construct an interval which can be polled. let mut interval = tokio::time::interval(self.interval.into());