feat: Add check for event.Series.LastObservedTime - #6825
Open
NachoxMacho wants to merge 2 commits into
Open
Conversation
Contributor
Signed commits reportAll 2 commits between |
NachoxMacho
force-pushed
the
fix/kubernetes-event-timestamp
branch
from
August 5, 2026 12:22
ed3195f to
ce8d11a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brief description of Pull Request
This updates the event timestamp check, to utilize the
series.lastObservedTimefield if present, and default to existing logic if it's not present. Adds an if statement to the event timestamp function for this check.Pull Request Details
The existing timestamp logic has an issue when an event doesn't get a
lastTimestampand only haseventTimeandseries.lastObservedTime. This causes events that are valid, but repeat using the series functionality to only be registered when they were initially created, making the timestamping inaccurate.This seems to be currently isolated to the scheduler's event reporting node availability when a pod can't be scheduled. For example:
I have not seen any instances in my investigation where both
lastTimestampandseries.lastObservedTimeare defined, however in this case I think it would be beneficial to use theseries.lastObservedTimeas that is the newer of the two fields.This also seems to be the general direction of the Kubernetes event structure going forward, with
lastTimestampbeing deprecated in 1.25, so I'd expect this problem to ripple out to other events as more get updated.Issue(s) fixed by this Pull Request
Fixes #206
Fixes #4140
Notes to the Reviewer
This is my first PR to the repository, so let me know if I've missed anything or this is an incorrect way to suggest a change. I have written all the content of the change and this PR description myself, and not used AI for any of the work related to this.
PR Checklist