Skip to content

Commit e93016b

Browse files
committed
fix_review_comments
1 parent 3f3ce86 commit e93016b

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

pkg/scheduler/framework/plugins/volumezone/volume_zone.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,28 +317,28 @@ func (pl *VolumeZone) isSchedulableAfterPersistentVolumeClaimChange(logger klog.
317317
if err != nil {
318318
return framework.Queue, fmt.Errorf("unexpected objects in isSchedulableAfterPersistentVolumeClaimChange: %w", err)
319319
}
320-
if pl.IsPVCRequestedFromPod(logger, modifiedPVC, pod) {
321-
logger.V(5).Info("PVC was created or updated and it might make this pod schedulable. PVC is binding to the pod.", "pod", klog.KObj(pod), "PVC", klog.KObj(modifiedPVC))
320+
if pl.isPVCRequestedFromPod(logger, modifiedPVC, pod) {
321+
logger.V(5).Info("PVC that is referred from the pod was created or updated, which might make this pod schedulable", "pod", klog.KObj(pod), "PVC", klog.KObj(modifiedPVC))
322322
return framework.Queue, nil
323323
}
324324

325325
logger.V(5).Info("PVC irrelevant to the Pod was created or updated, which doesn't make this pod schedulable", "pod", klog.KObj(pod), "PVC", klog.KObj(modifiedPVC))
326326
return framework.QueueSkip, nil
327327
}
328328

329-
// IsPVCRequestedFromPod verifies if the PVC is requested from a given Pod.
330-
func (pl *VolumeZone) IsPVCRequestedFromPod(logger klog.Logger, pvc *v1.PersistentVolumeClaim, pod *v1.Pod) bool {
329+
// isPVCRequestedFromPod verifies if the PVC is requested from a given Pod.
330+
func (pl *VolumeZone) isPVCRequestedFromPod(logger klog.Logger, pvc *v1.PersistentVolumeClaim, pod *v1.Pod) bool {
331331
if (pvc == nil) || (pod.Namespace != pvc.Namespace) {
332332
return false
333333
}
334334
pvcNames := pl.getPersistentVolumeClaimNameFromPod(pod)
335335
for _, pvcName := range pvcNames {
336336
if pvc.Name == pvcName {
337-
logger.V(5).Info("PVC matches the pod's PVC", "pod", klog.KObj(pod), "PVC", klog.KObj(pvc))
337+
logger.V(5).Info("PVC is referred from the pod", "pod", klog.KObj(pod), "PVC", klog.KObj(pvc))
338338
return true
339339
}
340340
}
341-
logger.V(5).Info("PVC doesn't match the pod's PVC", "pod", klog.KObj(pod), "PVC", klog.KObj(pvc))
341+
logger.V(5).Info("PVC is not referred from the pod", "pod", klog.KObj(pod), "PVC", klog.KObj(pvc))
342342
return false
343343
}
344344

pkg/scheduler/framework/plugins/volumezone/volume_zone_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -571,13 +571,13 @@ func TestIsSchedulableAfterPersistentVolumeClaimAdded(t *testing.T) {
571571
expectedHint framework.QueueingHint
572572
expectedErr bool
573573
}{
574-
"backoff-wrong-new-object": {
574+
"error-wrong-new-object": {
575575
pod: createPodWithVolume("pod_1", "PVC_1"),
576576
newObj: "not-a-pvc",
577577
expectedHint: framework.Queue,
578578
expectedErr: true,
579579
},
580-
"pvc-was-added-but-pod-was-not-bound-to-pvc": {
580+
"pvc-was-added-but-pod-refers-no-pvc": {
581581
pod: st.MakePod().Name("pod_1").Namespace("default").Obj(),
582582
newObj: &v1.PersistentVolumeClaim{
583583
ObjectMeta: metav1.ObjectMeta{Name: "PVC_1", Namespace: "default"},
@@ -601,15 +601,15 @@ func TestIsSchedulableAfterPersistentVolumeClaimAdded(t *testing.T) {
601601
},
602602
expectedHint: framework.QueueSkip,
603603
},
604-
"pvc-was-added-and-pod-was-bound-to-added-pvc": {
604+
"pvc-was-added-and-pod-was-bound-to-the-pvc": {
605605
pod: createPodWithVolume("pod_1", "PVC_1"),
606606
newObj: &v1.PersistentVolumeClaim{
607607
ObjectMeta: metav1.ObjectMeta{Name: "PVC_1", Namespace: "default"},
608608
Spec: v1.PersistentVolumeClaimSpec{VolumeName: "Vol_1"},
609609
},
610610
expectedHint: framework.Queue,
611611
},
612-
"pvc-was-updated-and-pod-was-bound-to-pvc": {
612+
"pvc-was-updated-and-pod-was-bound-to-the-pvc": {
613613
pod: createPodWithVolume("pod_1", "PVC_1"),
614614
oldObj: &v1.PersistentVolumeClaim{
615615
ObjectMeta: metav1.ObjectMeta{Name: "PVC_1", Namespace: "default"},
@@ -621,8 +621,8 @@ func TestIsSchedulableAfterPersistentVolumeClaimAdded(t *testing.T) {
621621
},
622622
expectedHint: framework.Queue,
623623
},
624-
"pvc-was-updated-but-pod-was-not-bound-to-pvc": {
625-
pod: createPodWithVolume("pod_1", ""),
624+
"pvc-was-updated-but-pod-refers-no-pvc": {
625+
pod: st.MakePod().Name("pod_1").Namespace(metav1.NamespaceDefault).Obj(),
626626
oldObj: &v1.PersistentVolumeClaim{
627627
ObjectMeta: metav1.ObjectMeta{Name: "PVC_1", Namespace: "default"},
628628
Spec: v1.PersistentVolumeClaimSpec{VolumeName: ""},

0 commit comments

Comments
 (0)