From da2e316b87ae4065db3128c5d9dd68fc7953d09e Mon Sep 17 00:00:00 2001 From: Stavros Kontopoulos Date: Mon, 27 May 2024 14:48:04 +0300 Subject: [PATCH] Skip lease with empty holder --- test/ha/ha.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/ha/ha.go b/test/ha/ha.go index eb991fcf8..36977c833 100644 --- a/test/ha/ha.go +++ b/test/ha/ha.go @@ -57,7 +57,8 @@ func GetLeaders(ctx context.Context, t *testing.T, client kubernetes.Interface, } ret := make([]string, 0, len(leases.Items)) for _, lease := range leases.Items { - if lease.Spec.HolderIdentity == nil { + if lease.Spec.HolderIdentity == nil || *lease.Spec.HolderIdentity == "" { + t.Logf("GetLeaders[%s] skipping lease %s as it has no holder", deploymentName, lease.Name) continue } pod := strings.SplitN(*lease.Spec.HolderIdentity, "_", 2)[0]