mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-10-28 21:48:24 +08:00
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.