kube-state-metrics icon indicating copy to clipboard operation
kube-state-metrics copied to clipboard

refactor: Replace ListerWatcher with ListerWatcherWithContext

Open onasser1 opened this issue 4 months ago • 10 comments

What this PR does / why we need it: ListerWatcher is deprecated and we need to move KSM code to use instead ListerWatcherWithContext How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality) N/A **Which issue(s) this PR fixes: Fixes #2721

onasser1 avatar Aug 09 '25 15:08 onasser1

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: onasser1 Once this PR has been reviewed and has the lgtm label, please assign dgrisonnet for approval. For more information see the 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:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Aug 09 '25 15:08 k8s-ci-robot

Welcome @onasser1!

It looks like this is your first PR to kubernetes/kube-state-metrics 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kube-state-metrics has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot avatar Aug 09 '25 15:08 k8s-ci-robot

/hold

onasser1 avatar Aug 09 '25 15:08 onasser1

I haven't fixed/worked on tests yet, and still doing some changes so I'd prefer to keep this as a draft until I finish my changes and I'd mention you for a review, so you can ignore this for couple of days. I'd revisit this tomorrow.

onasser1 avatar Aug 09 '25 17:08 onasser1

@dgrisonnet @rexagod Hi 👋🏻 I need help here, I guess I messed things up 🤔

onasser1 avatar Aug 11 '25 16:08 onasser1

Hi @mrueg 👋🏻 can you help me in your free time? this is an initial solution, if you have a better solution please let me know and I can start working on it.

onasser1 avatar Aug 11 '25 16:08 onasser1

@dgrisonnet @rexagod Hi 👋🏻 I need help here, I guess I messed things up 🤔

Hi @onasser1, you definitely haven’t messed anything up. I’d recommend taking some time to get familiar with the codebase, that will help you build confidence and make it easier to contribute. I also suggest joining the bi-weekly meeting, where you can ask any questions you might have and get valuable insights into the code. That way, you’ll avoid falling into the trap. You’re already doing amazing work ,keep it up!

Btw, maintainers and reviewers are at bandwidth, so please understand if they can’t always respond within your expected timeline.

assu-2000 avatar Aug 24 '25 09:08 assu-2000

@assu-2000 thank you for kind words 😃 I plan to do this actually.

onasser1 avatar Aug 24 '25 11:08 onasser1

/triage accepted

/assign @pohly

CatherineF-dev avatar Sep 10 '25 17:09 CatherineF-dev

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Dec 09 '25 18:12 k8s-triage-robot

/remove-lifecycle stale

dgrisonnet avatar Dec 19 '25 08:12 dgrisonnet

@onasser1 could you please address the CI failures?

dgrisonnet avatar Dec 19 '25 08:12 dgrisonnet