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 <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2021-02-12 17:25:44 +01:00 committed by mergify[bot]
parent b5020657e6
commit 8870575a48

View File

@ -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
}