From 51d03303c7a5306d3fc12e6ab6695f4b2448e315 Mon Sep 17 00:00:00 2001 From: Techassi Date: Thu, 25 Sep 2025 14:01:11 +0200 Subject: [PATCH] feat(operator): Use 'now' as built time if debug build --- crates/stackable-operator/src/eos/mod.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/crates/stackable-operator/src/eos/mod.rs b/crates/stackable-operator/src/eos/mod.rs index 3b63584c8..bb246ca0f 100644 --- a/crates/stackable-operator/src/eos/mod.rs +++ b/crates/stackable-operator/src/eos/mod.rs @@ -82,12 +82,18 @@ impl EndOfSupportChecker { .. } = options; - // Parse the built-time from the RFC2822-encoded string and add the support duration to it. - // This is datetime marks the end-of-support date. - let datetime = DateTime::parse_from_rfc2822(built_time) - .context(ParseBuiltTimeSnafu)? - .to_utc() - + *support_duration; + // Parse the built-time from the RFC2822-encoded string when this is compiled as a release + // build. If this is a debug/dev build, use the current datetime instead. + let mut datetime = if cfg!(debug_assertions) { + Utc::now() + } else { + DateTime::parse_from_rfc2822(built_time) + .context(ParseBuiltTimeSnafu)? + .to_utc() + }; + + // Add the support duration to the built date. This marks the end-of-support date. + datetime += *support_duration; Ok(Self { datetime, interval }) }