mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 05:03:09 +00:00
storage e2e: fix volume metric test for PVC
The fix for the ephemeral volume
case (7538d089d5
) broke the other variant with
PVC because pvc.Name is only set *after* creating the PVC.
This commit is contained in:
parent
c0bdf14942
commit
d6aa7e321f
@ -213,7 +213,6 @@ var _ = utils.SIGDescribe("[Serial] Volume metrics", func() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
filesystemMode := func(isEphemeral bool) {
|
filesystemMode := func(isEphemeral bool) {
|
||||||
pvcName := pvc.Name
|
|
||||||
if !isEphemeral {
|
if !isEphemeral {
|
||||||
pvc, err = c.CoreV1().PersistentVolumeClaims(pvc.Namespace).Create(context.TODO(), pvc, metav1.CreateOptions{})
|
pvc, err = c.CoreV1().PersistentVolumeClaims(pvc.Namespace).Create(context.TODO(), pvc, metav1.CreateOptions{})
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
@ -230,6 +229,7 @@ var _ = utils.SIGDescribe("[Serial] Volume metrics", func() {
|
|||||||
pod, err = c.CoreV1().Pods(ns).Get(context.TODO(), pod.Name, metav1.GetOptions{})
|
pod, err = c.CoreV1().Pods(ns).Get(context.TODO(), pod.Name, metav1.GetOptions{})
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
|
|
||||||
|
pvcName := pvc.Name
|
||||||
if isEphemeral {
|
if isEphemeral {
|
||||||
pvcName = ephemeral.VolumeClaimName(pod, &pod.Spec.Volumes[0])
|
pvcName = ephemeral.VolumeClaimName(pod, &pod.Spec.Volumes[0])
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user