Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions crates/stackable-operator/src/eos/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
}
Expand Down