@@ -864,7 +864,7 @@ func TestCoreResourceEnqueue(t *testing.T) {
864
864
enableSchedulingQueueHint : []bool {true },
865
865
},
866
866
{
867
- name : "Pod rejected with node by the VolumeZone plugin is requeued when the PVC is added" ,
867
+ name : "Pod rejected with node by the VolumeZone plugin is requeued when the PVC bound to the pod is added" ,
868
868
initialNodes : []* v1.Node {st .MakeNode ().Name ("fake-node" ).Label ("node" , "fake-node" ).Label (v1 .LabelTopologyZone , "us-west1-a" ).Obj ()},
869
869
initialPVs : []* v1.PersistentVolume {
870
870
st .MakePersistentVolume ().
@@ -914,7 +914,7 @@ func TestCoreResourceEnqueue(t *testing.T) {
914
914
enableSchedulingQueueHint : []bool {true },
915
915
},
916
916
{
917
- name : "Pod rejected with node by the VolumeZone plugin is requeued when the PVC is updated" ,
917
+ name : "Pod rejected with node by the VolumeZone plugin is requeued when the PVC bound to the pod is updated" ,
918
918
initialNodes : []* v1.Node {st .MakeNode ().Name ("fake-node" ).Label ("node" , "fake-node" ).Label (v1 .LabelTopologyZone , "us-west1-a" ).Obj ()},
919
919
initialPVs : []* v1.PersistentVolume {
920
920
st .MakePersistentVolume ().
@@ -1018,7 +1018,7 @@ func TestCoreResourceEnqueue(t *testing.T) {
1018
1018
enableSchedulingQueueHint : []bool {true },
1019
1019
},
1020
1020
{
1021
- name : "Pod rejected with node by the VolumeZone plugin is not requeued when the unrelated label of PV is updated " ,
1021
+ name : "Pod rejected with node by the VolumeZone plugin is not requeued when the unrelated PVC is added " ,
1022
1022
initialNodes : []* v1.Node {st .MakeNode ().Name ("fake-node" ).Label ("node" , "fake-node" ).Label (v1 .LabelTopologyZone , "us-west1-a" ).Obj ()},
1023
1023
initialPVs : []* v1.PersistentVolume {
1024
1024
st .MakePersistentVolume ().
@@ -1058,13 +1058,14 @@ func TestCoreResourceEnqueue(t *testing.T) {
1058
1058
st .MakePod ().Name ("pod2" ).Container ("image" ).PVC ("pvc2" ).Obj (),
1059
1059
},
1060
1060
triggerFn : func (testCtx * testutils.TestContext ) error {
1061
- pv2 := st .MakePersistentVolume ().Name ("pv2" ).Labels (map [string ]string {v1 .LabelTopologyZone : "us-east1" }).
1062
- AccessModes ([]v1.PersistentVolumeAccessMode {v1 .ReadOnlyMany }).
1063
- Capacity (v1.ResourceList {v1 .ResourceStorage : resource .MustParse ("1Mi" )}).
1064
- HostPathVolumeSource (& v1.HostPathVolumeSource {Path : "/tmp" , Type : & volType }).
1061
+ pvc3 := st .MakePersistentVolumeClaim ().
1062
+ Name ("pvc3" ).
1063
+ Annotation (volume .AnnBindCompleted , "true" ).
1064
+ AccessModes ([]v1.PersistentVolumeAccessMode {v1 .ReadWriteOncePod }).
1065
+ Resources (v1.VolumeResourceRequirements {Requests : v1.ResourceList {v1 .ResourceStorage : resource .MustParse ("1Mi" )}}).
1065
1066
Obj ()
1066
- if _ , err := testCtx .ClientSet .CoreV1 ().PersistentVolumes (). Update (testCtx .Ctx , pv2 , metav1.UpdateOptions {}); err != nil {
1067
- return fmt .Errorf ("failed to update pv2 : %w" , err )
1067
+ if _ , err := testCtx .ClientSet .CoreV1 ().PersistentVolumeClaims ( testCtx . NS . Name ). Create (testCtx .Ctx , pvc3 , metav1.CreateOptions {}); err != nil {
1068
+ return fmt .Errorf ("failed to create pvc3 : %w" , err )
1068
1069
}
1069
1070
return nil
1070
1071
},
0 commit comments