Skip to content

Commit

Permalink
Skip lease with empty holder
Browse files Browse the repository at this point in the history
  • Loading branch information
skonto committed May 27, 2024
1 parent 360b72e commit da2e316
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/ha/ha.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit da2e316

Please sign in to comment.