kubernetes / kube-state-metrics

Add-on agent to generate and expose cluster-level metrics.
https://kubernetes.io/docs/concepts/cluster-administration/kube-state-metrics/
Apache License 2.0
5.21k stars 1.93k forks source link

Clean up `select {}` #2314

Closed CatherineF-dev closed 4 months ago

CatherineF-dev commented 4 months ago

What this PR does / why we need it:

How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality) N/A

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged): Fixes #

k8s-ci-robot commented 4 months ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: CatherineF-dev Once this PR has been reviewed and has the lgtm label, please assign mrueg for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/kubernetes/kube-state-metrics/blob/main/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
CatherineF-dev commented 4 months ago

cc @mrueg to review.

Does this select {} have some special purposes?

dashpole commented 4 months ago

/assign @rexagod /triage accepted

mrueg commented 4 months ago

AFAIK the select here is used to block similar to an infinite for loop.

rexagod commented 4 months ago

Yep, closing.