Skip to content

feat: implement proper context in scope methods#1575

Open
salasberryfin wants to merge 1 commit into
kubernetes-sigs:mainfrom
salasberryfin:fix-context-scope-methods
Open

feat: implement proper context in scope methods#1575
salasberryfin wants to merge 1 commit into
kubernetes-sigs:mainfrom
salasberryfin:fix-context-scope-methods

Conversation

@salasberryfin
Copy link
Copy Markdown
Contributor

/kind feature

What this PR does / why we need it:

As discussed in #1506 (comment) there's no proper context in place for scope methods and using context.TODO() is not a valid solution as it's only expected to be used temporarily, for testing or in non-production projects. Effectively this is simply a workaround for passing a nil value to functions that require a context object but it just won't ever timeout.

This PR tries to implement proper context to scope methods. I think I updated all of them, but feel free to call me out on any missing occurrences of context.TODO().

Which issue(s) this PR fixes:
Fixes #1573

Special notes for your reviewer:

No changes are applied to testing files where context.TODO() is still used and should be considered a valid solution for simpler context management.

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. labels Dec 23, 2025
@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 23, 2025

Deploy Preview for kubernetes-sigs-cluster-api-gcp ready!

Name Link
🔨 Latest commit f6f92ee
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-cluster-api-gcp/deploys/694ad048fe3ec10008d07733
😎 Deploy Preview https://deploy-preview-1575--kubernetes-sigs-cluster-api-gcp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: salasberryfin

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

The pull request process is described here

Details 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 k8s-ci-robot requested a review from cpanato December 23, 2025 17:17
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 23, 2025
@k8s-ci-robot k8s-ci-robot requested a review from dims December 23, 2025 17:17
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 23, 2025
Signed-off-by: Carlos Salas <carlos.salas@suse.com>
@salasberryfin salasberryfin force-pushed the fix-context-scope-methods branch from e66056a to f6f92ee Compare December 23, 2025 17:24
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 31, 2026
@k8s-triage-robot
Copy link
Copy Markdown

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-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement proper contexts in scope methods

3 participants