From 194b31019d489e43004a179af9c841f7be5939c0 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Tue, 26 Oct 2021 17:32:59 +0200 Subject: [PATCH] volume e2e: block volume metrics fix, II Copying from pvcBlock swapped name and namespace (breaking the PVC test case) and some references to the pvcBlock variable were left unchanged (incorrect annotations for test failures). --- test/e2e/storage/volume_metrics.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/e2e/storage/volume_metrics.go b/test/e2e/storage/volume_metrics.go index fb9e06f0387..9fae69ac7eb 100644 --- a/test/e2e/storage/volume_metrics.go +++ b/test/e2e/storage/volume_metrics.go @@ -304,8 +304,8 @@ var _ = utils.SIGDescribe("[Serial] Volume metrics", func() { } key := volumeStatKeys[0] kubeletKeyName := fmt.Sprintf("%s_%s", kubeletmetrics.KubeletSubsystem, key) - pvcName := pvcBlock.Namespace - pvcNamespace := pvcBlock.Name + pvcName := pvcBlock.Name + pvcNamespace := pvcBlock.Namespace if isEphemeral { pvcName = ephemeral.VolumeClaimName(pod, &pod.Spec.Volumes[0]) pvcNamespace = pod.Namespace @@ -327,12 +327,12 @@ var _ = utils.SIGDescribe("[Serial] Volume metrics", func() { } return true, nil }) - framework.ExpectNoError(waitErr, "Unable to find metric %s for PVC %s/%s", kubeletKeyName, pvcBlock.Namespace, pvcBlock.Name) + framework.ExpectNoError(waitErr, "Unable to find metric %s for PVC %s/%s", kubeletKeyName, pvcNamespace, pvcName) for _, key := range volumeStatKeys { kubeletKeyName := fmt.Sprintf("%s_%s", kubeletmetrics.KubeletSubsystem, key) found := findVolumeStatMetric(kubeletKeyName, pvcNamespace, pvcName, kubeMetrics) - framework.ExpectEqual(found, true, "PVC %s, Namespace %s not found for %s", pvcBlock.Name, pvcBlock.Namespace, kubeletKeyName) + framework.ExpectEqual(found, true, "PVC %s, Namespace %s not found for %s", pvcName, pvcNamespace, kubeletKeyName) } framework.Logf("Deleting pod %q/%q", pod.Namespace, pod.Name)