Files
Joe Betz a2d116f5c9 Add test cases for Quantity behaviors that changed with the int64 overflow work
The #141166 burndown changed how Quantity accessors overflow and tightened
several validators. Some callers changed behavior with it, and some of the
tightened checks run again on update without a ratchet. This adds table
cases for each of those behaviors to the existing tests of the functions
involved. Each case records today's result; the ones that are wrong carry
a TODO(#141166) comment saying what the result must become, so fixing one
is a matter of updating the row and removing the comment.

Cases added, by test:
- TestValidatePodUpdate, TestValidatePodResize,
  TestValidatePodEphemeralContainersUpdate, TestValidatePodTemplateUpdate,
  TestValidateNodeUpdate, TestValidatePersistentVolumeClaimStatusUpdate,
  TestValidateLimitRange (pkg/apis/core/validation)
- TestValidateOverhead (pkg/apis/node/validation) and TestValidateUpdate
  (pkg/registry/node/runtimeclass)
- TestValidateDeviceCapacity, TestQuantityKeyAsDec, TestIsFractionalQuantity
  (pkg/apis/resource/validation)
- testCalculateConsumedCapacity in the experimental and incubating DRA
  allocators
- TestLimitRangerRatioIsExact, TestLimitRequestRatioConstraint
  (plugin/pkg/admission/limitranger)
- TestCalculateCPUMaximum, TestCalculateTimeoutForVolume,
  TestNodeExpandVolume, Test_AddPodToVolume_WithEmptyDirSizeLimit
- TestQuantityCmpInt64AndDec, TestQuantityCmpInt64,
  TestQuantityStringBelowNano (k8s.io/apimachinery/pkg/api/resource)

Also makes the allocatortesting "claims must not be modified" check
compare against deep copies taken before allocation; it compared the same
pointers to themselves and could not fail.
2026-09-18 11:13:32 -04:00
..
2021-03-02 12:06:13 -05:00
2024-12-02 16:59:34 +01:00
2022-11-22 16:59:25 +08:00