Add test for listing Leases from all namespace

This commit is contained in:
wojtekt 2020-09-22 13:43:57 +02:00
parent b03a4ac626
commit a65fec2a8a

View File

@ -156,5 +156,13 @@ var _ = framework.KubeDescribe("Lease", func() {
_, err = leaseClient.Get(context.TODO(), name, metav1.GetOptions{})
framework.ExpectEqual(apierrors.IsNotFound(err), true)
leaseClient = f.ClientSet.CoordinationV1().Leases(metav1.NamespaceAll)
// Number of leases may be high in large clusters, as Lease object is
// created for every node by the corresponding Kubelet.
// That said, the objects themselves are small (~300B), so even with 5000
// of them, that gives ~1.5MB, which is acceptable.
_, err = leaseClient.List(context.TODO(), metav1.ListOptions{})
framework.ExpectNoError(err, "couldn't list Leases from all namespace")
})
})