Skip to content

Commit e192ac3

Browse files
committed
Migrate Count to Kubernetes client
1 parent 2fcd321 commit e192ac3

File tree

1 file changed

+2
-2
lines changed
  • staging/src/k8s.io/apiserver/pkg/storage/etcd3

1 file changed

+2
-2
lines changed

staging/src/k8s.io/apiserver/pkg/storage/etcd3/store.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,12 +573,12 @@ func (s *store) Count(key string) (int64, error) {
573573
}
574574

575575
startTime := time.Now()
576-
getResp, err := s.client.KV.Get(context.Background(), preparedKey, clientv3.WithRange(clientv3.GetPrefixRangeEnd(preparedKey)), clientv3.WithCountOnly())
576+
count, err := s.client.Kubernetes.Count(context.Background(), preparedKey, kubernetes.CountOptions{})
577577
metrics.RecordEtcdRequest("listWithCount", preparedKey, err, startTime)
578578
if err != nil {
579579
return 0, err
580580
}
581-
return getResp.Count, nil
581+
return count, nil
582582
}
583583

584584
// ReadinessCheck implements storage.Interface.

0 commit comments

Comments
 (0)