Pin now time during the access request creation#40325
Conversation
The `clockwork` package was removed and handling of time elements has been refactored in codebase. The current time was set once and then passed as an argument to the functions that need it, reducing calls to retrieve the current time. This change simplifies the code and makes it more robust against time drifts.
Removed the use of fake clock in tsh_test.go and kube_test.go to imitate real-world behavior more accurately. This change is aimed at improving the credibility and reliability of those test cases.
|
The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with |
|
The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with |
zmb3
left a comment
There was a problem hiding this comment.
Looks good, but I also think its odd that we do a time comparison (without rounding times) and then log the rounded version of the time. This makes troubleshooting difficult.
Should we either round before comparing, or log the exact values that we used to do the comparison?
|
/excludeflake * |
This commit updates the comments in `access_request.go` and `access_request_test.go` files to improve grammar and punctuation for better readability and understanding of the code. This includes correction of typographical errors, addition of punctuation where necessary, and clarification of some comments for more precise descriptions.
The code changes refine messages for validation errors related to TTL. The error messages returned when requested TTLs exceed the maximum allowed amounts are improved. Time is no longer rounded to minutes, providing more precise error messages.
I changed the logger to log the exact value. |
To prevent time drift, this change pins the time during access time calculations.
Remove the fake clock from the tests to better simulate the real-time behavior.
changelog: Fix
invalid session TTLwhen creating access request withtsh