mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 09:49:50 +00:00
add_non_queued_pod
This commit is contained in:
parent
d5e9199229
commit
090145aadf
@ -896,6 +896,7 @@ func TestCoreResourceEnqueue(t *testing.T) {
|
|||||||
},
|
},
|
||||||
pods: []*v1.Pod{
|
pods: []*v1.Pod{
|
||||||
st.MakePod().Name("pod2").Container("image").PVC("pvc2").Obj(),
|
st.MakePod().Name("pod2").Container("image").PVC("pvc2").Obj(),
|
||||||
|
st.MakePod().Name("pod3").Container("image").PVC("pvc3").Obj(),
|
||||||
},
|
},
|
||||||
triggerFn: func(testCtx *testutils.TestContext) error {
|
triggerFn: func(testCtx *testutils.TestContext) error {
|
||||||
pvc2 := st.MakePersistentVolumeClaim().
|
pvc2 := st.MakePersistentVolumeClaim().
|
||||||
@ -952,6 +953,7 @@ func TestCoreResourceEnqueue(t *testing.T) {
|
|||||||
},
|
},
|
||||||
pods: []*v1.Pod{
|
pods: []*v1.Pod{
|
||||||
st.MakePod().Name("pod2").Container("image").PVC("pvc2").Obj(),
|
st.MakePod().Name("pod2").Container("image").PVC("pvc2").Obj(),
|
||||||
|
st.MakePod().Name("pod3").Container("image").PVC("pvc3").Obj(),
|
||||||
},
|
},
|
||||||
triggerFn: func(testCtx *testutils.TestContext) error {
|
triggerFn: func(testCtx *testutils.TestContext) error {
|
||||||
pvc2 := st.MakePersistentVolumeClaim().
|
pvc2 := st.MakePersistentVolumeClaim().
|
||||||
@ -1017,61 +1019,6 @@ func TestCoreResourceEnqueue(t *testing.T) {
|
|||||||
wantRequeuedPods: sets.New("pod2"),
|
wantRequeuedPods: sets.New("pod2"),
|
||||||
enableSchedulingQueueHint: []bool{true},
|
enableSchedulingQueueHint: []bool{true},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "Pod rejected with node by the VolumeZone plugin is not requeued when the unrelated PVC is added",
|
|
||||||
initialNodes: []*v1.Node{st.MakeNode().Name("fake-node").Label("node", "fake-node").Label(v1.LabelTopologyZone, "us-west1-a").Obj()},
|
|
||||||
initialPVs: []*v1.PersistentVolume{
|
|
||||||
st.MakePersistentVolume().
|
|
||||||
Name("pv1").
|
|
||||||
Labels(map[string]string{v1.LabelTopologyZone: "us-west1-a"}).
|
|
||||||
AccessModes([]v1.PersistentVolumeAccessMode{v1.ReadOnlyMany}).
|
|
||||||
Capacity(v1.ResourceList{v1.ResourceStorage: resource.MustParse("1Mi")}).
|
|
||||||
HostPathVolumeSource(&v1.HostPathVolumeSource{Path: "/tmp", Type: &volType}).
|
|
||||||
Obj(),
|
|
||||||
st.MakePersistentVolume().
|
|
||||||
Name("pv2").
|
|
||||||
Labels(map[string]string{v1.LabelTopologyZone: "us-east1"}).
|
|
||||||
AccessModes([]v1.PersistentVolumeAccessMode{v1.ReadOnlyMany}).
|
|
||||||
Capacity(v1.ResourceList{v1.ResourceStorage: resource.MustParse("1Mi")}).
|
|
||||||
HostPathVolumeSource(&v1.HostPathVolumeSource{Path: "/tmp", Type: &volType}).
|
|
||||||
Obj(),
|
|
||||||
},
|
|
||||||
initialPVCs: []*v1.PersistentVolumeClaim{
|
|
||||||
st.MakePersistentVolumeClaim().
|
|
||||||
Name("pvc1").
|
|
||||||
Annotation(volume.AnnBindCompleted, "true").
|
|
||||||
VolumeName("pv1").
|
|
||||||
AccessModes([]v1.PersistentVolumeAccessMode{v1.ReadWriteOncePod}).
|
|
||||||
Resources(v1.VolumeResourceRequirements{Requests: v1.ResourceList{v1.ResourceStorage: resource.MustParse("1Mi")}}).
|
|
||||||
Obj(),
|
|
||||||
st.MakePersistentVolumeClaim().
|
|
||||||
Name("pvc2").
|
|
||||||
Annotation(volume.AnnBindCompleted, "true").
|
|
||||||
AccessModes([]v1.PersistentVolumeAccessMode{v1.ReadWriteOncePod}).
|
|
||||||
Resources(v1.VolumeResourceRequirements{Requests: v1.ResourceList{v1.ResourceStorage: resource.MustParse("1Mi")}}).
|
|
||||||
Obj(),
|
|
||||||
},
|
|
||||||
initialPods: []*v1.Pod{
|
|
||||||
st.MakePod().Name("pod1").Container("image").PVC("pvc1").Node("fake-node").Obj(),
|
|
||||||
},
|
|
||||||
pods: []*v1.Pod{
|
|
||||||
st.MakePod().Name("pod2").Container("image").PVC("pvc2").Obj(),
|
|
||||||
},
|
|
||||||
triggerFn: func(testCtx *testutils.TestContext) error {
|
|
||||||
pvc3 := st.MakePersistentVolumeClaim().
|
|
||||||
Name("pvc3").
|
|
||||||
Annotation(volume.AnnBindCompleted, "true").
|
|
||||||
AccessModes([]v1.PersistentVolumeAccessMode{v1.ReadWriteOncePod}).
|
|
||||||
Resources(v1.VolumeResourceRequirements{Requests: v1.ResourceList{v1.ResourceStorage: resource.MustParse("1Mi")}}).
|
|
||||||
Obj()
|
|
||||||
if _, err := testCtx.ClientSet.CoreV1().PersistentVolumeClaims(testCtx.NS.Name).Create(testCtx.Ctx, pvc3, metav1.CreateOptions{}); err != nil {
|
|
||||||
return fmt.Errorf("failed to create pvc3: %w", err)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
},
|
|
||||||
wantRequeuedPods: sets.Set[string]{},
|
|
||||||
enableSchedulingQueueHint: []bool{true},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
|
Loading…
Reference in New Issue
Block a user