From 8870575a48a84b8a60e6dfd526ad0b96a1e3b0c0 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Fri, 12 Feb 2021 17:25:44 +0100 Subject: [PATCH] e2e: compare resource.Quantity with Equals() instead of operator When one Quantity is in GiB, and the other in Dec (bytes), the value should be the same. However, by using ==, this is not the case. It is needed to use Equals() for that. Signed-off-by: Niels de Vos --- e2e/resize.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/resize.go b/e2e/resize.go index 71a01b068..f7df2b55c 100644 --- a/e2e/resize.go +++ b/e2e/resize.go @@ -52,7 +52,7 @@ func expandPVCSize(c kubernetes.Interface, pvc *v1.PersistentVolumeClaim, size s } } - if updatedPVC.Status.Capacity[v1.ResourceStorage] != resource.MustParse(size) { + if !updatedPVC.Status.Capacity[v1.ResourceStorage].Equal(resource.MustParse(size)) { e2elog.Logf("current size in status %v,expected size %v", updatedPVC.Status.Capacity[v1.ResourceStorage], resource.MustParse(size)) return false, nil }