From b9d9a5ebed6caa480d0a31281c4033694016b553 Mon Sep 17 00:00:00 2001 From: Dave Chen Date: Fri, 11 Dec 2020 16:57:51 +0800 Subject: [PATCH] Make sure the volume name is not empty when the PVC is bound Current logic to check whether a PVC is fully bound are: 1. PVC's volume name is not empty 2. Annotation "pv.kubernetes.io/bind-completed" is properly set The behavior in the test case only set the annotation, and leave the volume name to be set by a `FakePVController`. This will cause a problem for us to run some testcase like scheduler's perf test, scheduling pod with volume as an example, the first try will always hit "unbound immediate PersistentVolumeClaims" exception. As a result, the metric data "schedule_attempts_total", or "scheduling_algorithm_duration_seconds" will not accurate enough. Signed-off-by: Dave Chen --- test/utils/runners.go | 1 + 1 file changed, 1 insertion(+) diff --git a/test/utils/runners.go b/test/utils/runners.go index f81c56132c1..fe4ff16691d 100644 --- a/test/utils/runners.go +++ b/test/utils/runners.go @@ -1369,6 +1369,7 @@ func CreatePodWithPersistentVolume(client clientset.Interface, namespace string, pv.Status.Phase = v1.VolumeBound // bind pvc to "pv-$i" + pvc.Spec.VolumeName = pv.Name pvc.Status.Phase = v1.ClaimBound } else { pv.Status.Phase = v1.VolumeAvailable