Closed tylerslaton closed 8 months ago
The recent update introduces a significant overhaul in how compute and volume storage resources are managed, shifting from individual resource quantities to structured ComputeClasses
and VolumeClasses
. This change affects resource tracking, allocation, and comparison across the system. Modifications include updates to resource addition, removal, fit checks, and string representation, alongside the introduction of new structures and methods tailored to handle the complexities of compute and volume class resources efficiently.
Files | Change Summary |
---|---|
.../v1/baseresources.go .../v1/quotarequests.go |
Introduced ComputeClasses and VolumeClasses , updated methods for resource management, and modified ToString representations. |
.../v1/baseresources_test.go .../v1/quotarequests_test.go |
Adjusted tests for adding, removing, and comparing resources, including handling of ComputeClasses and VolumeClasses . |
.../v1/computeclassresources.go .../v1/volumeclassresources.go |
Added functionality for managing compute and volume class resources, with methods for resource operations. |
.../v1/computeclassresources_test.go .../v1/volumeclassresources_test.go |
Provided tests for compute and volume class resource functions. |
.../v1/resources.go |
Updated resource subtraction logic and string conversion functions. |
.../v1/zz_generated.deepcopy.go |
Updated DeepCopyInto for BaseResources and added copy methods for new resource types. |
.../controller/quota/quota.go |
Modified quota request handling to accommodate computeClasses and volumeClasses . |
.../controller/quota/testdata/.../expected.golden |
Updated test data to reflect new resource allocation specifications with computeClasses and volumeClasses . |
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
This commit enhances the BaseResources struct by adding ComputeClasses and VolumeClasses fields. These new fields allow for a more detailed specification of compute and storage resources, categorized by class instead of just by resource type.
This enhancement is crucial for accurately tracking the usage of memory, CPU, and storage for each specific compute or volume class. Consequently, the QuotaRequest logic has been updated to account for these new fields.
These new fields are maps and they introduce a unique approach to handle unlimited resources. They include special keys,
AllComputeClasses
andAllVolumeClasses
. If a value is assigned to these keys in ComputeClassResources or VolumeClassResources, all compute or volume classes will be evaluated against the value.Checklist
This is a title (#1216)
. Here's an exampleSummary by CodeRabbit
ComputeClasses
andVolumeClasses
.ComputeClasses
andVolumeClasses
.