Skip to content

Conversation

@salasberryfin
Copy link
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

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
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
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. 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

2 participants