mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Merge pull request #116066 from yoongon/feature/fit-test-comments
Fix comments at fit_test.go to increase redability
This commit is contained in:
commit
9d7db70882
@ -535,25 +535,25 @@ func TestNotEnoughRequests(t *testing.T) {
|
|||||||
{
|
{
|
||||||
pod: &v1.Pod{},
|
pod: &v1.Pod{},
|
||||||
nodeInfo: framework.NewNodeInfo(newResourcePod(framework.Resource{MilliCPU: 10, Memory: 20})),
|
nodeInfo: framework.NewNodeInfo(newResourcePod(framework.Resource{MilliCPU: 10, Memory: 20})),
|
||||||
name: "even without specified resources predicate fails when there's no space for additional pod",
|
name: "even without specified resources, predicate fails when there's no space for additional pod",
|
||||||
wantStatus: framework.NewStatus(framework.Unschedulable, "Too many pods"),
|
wantStatus: framework.NewStatus(framework.Unschedulable, "Too many pods"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pod: newResourcePod(framework.Resource{MilliCPU: 1, Memory: 1}),
|
pod: newResourcePod(framework.Resource{MilliCPU: 1, Memory: 1}),
|
||||||
nodeInfo: framework.NewNodeInfo(newResourcePod(framework.Resource{MilliCPU: 5, Memory: 5})),
|
nodeInfo: framework.NewNodeInfo(newResourcePod(framework.Resource{MilliCPU: 5, Memory: 5})),
|
||||||
name: "even if both resources fit predicate fails when there's no space for additional pod",
|
name: "even if both resources fit, predicate fails when there's no space for additional pod",
|
||||||
wantStatus: framework.NewStatus(framework.Unschedulable, "Too many pods"),
|
wantStatus: framework.NewStatus(framework.Unschedulable, "Too many pods"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pod: newResourcePod(framework.Resource{MilliCPU: 5, Memory: 1}),
|
pod: newResourcePod(framework.Resource{MilliCPU: 5, Memory: 1}),
|
||||||
nodeInfo: framework.NewNodeInfo(newResourcePod(framework.Resource{MilliCPU: 5, Memory: 19})),
|
nodeInfo: framework.NewNodeInfo(newResourcePod(framework.Resource{MilliCPU: 5, Memory: 19})),
|
||||||
name: "even for equal edge case predicate fails when there's no space for additional pod",
|
name: "even for equal edge case, predicate fails when there's no space for additional pod",
|
||||||
wantStatus: framework.NewStatus(framework.Unschedulable, "Too many pods"),
|
wantStatus: framework.NewStatus(framework.Unschedulable, "Too many pods"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pod: newResourceInitPod(newResourcePod(framework.Resource{MilliCPU: 5, Memory: 1}), framework.Resource{MilliCPU: 5, Memory: 1}),
|
pod: newResourceInitPod(newResourcePod(framework.Resource{MilliCPU: 5, Memory: 1}), framework.Resource{MilliCPU: 5, Memory: 1}),
|
||||||
nodeInfo: framework.NewNodeInfo(newResourcePod(framework.Resource{MilliCPU: 5, Memory: 19})),
|
nodeInfo: framework.NewNodeInfo(newResourcePod(framework.Resource{MilliCPU: 5, Memory: 19})),
|
||||||
name: "even for equal edge case predicate fails when there's no space for additional pod due to init container",
|
name: "even for equal edge case, predicate fails when there's no space for additional pod due to init container",
|
||||||
wantStatus: framework.NewStatus(framework.Unschedulable, "Too many pods"),
|
wantStatus: framework.NewStatus(framework.Unschedulable, "Too many pods"),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -588,18 +588,11 @@ func TestStorageRequests(t *testing.T) {
|
|||||||
name string
|
name string
|
||||||
wantStatus *framework.Status
|
wantStatus *framework.Status
|
||||||
}{
|
}{
|
||||||
{
|
|
||||||
pod: newResourcePod(framework.Resource{MilliCPU: 1, Memory: 1}),
|
|
||||||
nodeInfo: framework.NewNodeInfo(
|
|
||||||
newResourcePod(framework.Resource{MilliCPU: 10, Memory: 10})),
|
|
||||||
name: "due to container scratch disk",
|
|
||||||
wantStatus: framework.NewStatus(framework.Unschedulable, getErrReason(v1.ResourceCPU)),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
pod: newResourcePod(framework.Resource{MilliCPU: 1, Memory: 1}),
|
pod: newResourcePod(framework.Resource{MilliCPU: 1, Memory: 1}),
|
||||||
nodeInfo: framework.NewNodeInfo(
|
nodeInfo: framework.NewNodeInfo(
|
||||||
newResourcePod(framework.Resource{MilliCPU: 2, Memory: 10})),
|
newResourcePod(framework.Resource{MilliCPU: 2, Memory: 10})),
|
||||||
name: "pod fit",
|
name: "empty storage requested, and pod fits",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pod: newResourcePod(framework.Resource{EphemeralStorage: 25}),
|
pod: newResourcePod(framework.Resource{EphemeralStorage: 25}),
|
||||||
|
Loading…
Reference in New Issue
Block a user