Skip to content

Commit 36685c6

Browse files
committed
Add information about expected status
1 parent 784c589 commit 36685c6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/e2e/storage/testsuites/volume_expand.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,12 +492,14 @@ func WaitForFSResize(ctx context.Context, pvc *v1.PersistentVolumeClaim, c clien
492492
func VerifyRecoveryRelatedFields(pvc *v1.PersistentVolumeClaim) error {
493493
resizeStatus := pvc.Status.AllocatedResourceStatuses[v1.ResourceStorage]
494494
if resizeStatus != "" {
495-
return fmt.Errorf("pvc %q had %s resize status", pvc.Name, resizeStatus)
495+
return fmt.Errorf("pvc %q had %s resize status, expected none", pvc.Name, resizeStatus)
496496
}
497497

498498
allocatedSize := pvc.Status.AllocatedResources[v1.ResourceStorage]
499-
if allocatedSize.Cmp(pvc.Spec.Resources.Requests[v1.ResourceStorage]) != 0 {
500-
return fmt.Errorf("pvc %q had %s allocated size", pvc.Name, allocatedSize.String())
499+
requestedSize := pvc.Spec.Resources.Requests[v1.ResourceStorage]
500+
// at this point allocatedSize should be greater than pvc resource request
501+
if allocatedSize.Cmp(requestedSize) < 0 {
502+
return fmt.Errorf("pvc %q had %s allocated size, expected %s", pvc.Name, allocatedSize.String(), requestedSize.String())
501503
}
502504
return nil
503505
}

0 commit comments

Comments
 (0)