Take Rawusage reset date into account when determining start date for sreport
calls
#237
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.
Currently, the start date provided to sreport is just the earliest start date across a group's active allocations. This is not necessarily accurate as the usage value being compared against the limits is the usage since the last raw usage reset.
This PR take the rawusage reset date into consideration, by returning the max of the earliest start date found and the most recent raw usage reset date. We want the max because start dates found prior to the raw usage reset date are what's creating the possibility of > 100% usage in the crc-usage output.
I tested this works properly on the cluster, and that it does not break
crc-sus
.Before:
After: