-
Notifications
You must be signed in to change notification settings - Fork 308
Add last resort to KubernetesJson parse DateTimeOff #1705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: luiscantero The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a last resort fallback mechanism to the KubernetesDateTimeOffsetConverter to handle DateTimeOffset parsing for edge cases not covered by the strict RFC3339 format variants. The change aims to make the parser more lenient by falling back to general DateTimeOffset.TryParse when specific format parsing fails.
- Introduces a static
StandardFormatsarray to avoid repeated array allocation - Adds a fallback using general
DateTimeOffset.TryParsewithDateTimeStyles.RoundtripKind - Removes redundant array allocation in line 52 by passing the format string directly
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes #1704