Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagating contexts to all remaining scalers #2267

Merged
merged 3 commits into from
Nov 10, 2021

Conversation

arschles
Copy link
Contributor

@arschles arschles commented Nov 9, 2021

In #2022 and then again in #2187, work was done to propagate context.Context values down most call stacks, terminating in scaler logic. Now that #2187 is merged, this PR completes that work. Most of the changes herein are mechanical, adding context.Context to function signatures and passing the incoming parameter to functions as necessary. This PR removes all remaining uses of context.TODO() and context.Background() in non-test code in favor of a context from the caller. Root contexts (from the main function) come from the controller-runtime signal handler.

Checklist

  • Commits are signed with Developer Certificate of Origin (DCO - learn more)
  • Tests have been added
  • A PR is opened to update our Helm chart (repo) (if applicable, ie. when deployment manifests are modified) (N/A)
  • A PR is opened to update the documentation on (repo) (if applicable) (N/A)
  • Changelog has been updated

Fixes #2190

@jerbob92 can you take a look at this PR? I think I addressed all of the changes that you are looking for, but I'd like to make sure.

Signed-off-by: Aaron Schlesinger <[email protected]>
@arschles arschles marked this pull request as draft November 9, 2021 23:10
@arschles arschles marked this pull request as ready for review November 9, 2021 23:41
@zroubalik
Copy link
Member

/run-e2e

@jerbob92
Copy link
Contributor

@arschles I do not have a very deep understanding of KEDA's codebase, but LGTM :)

Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM,

thanks @arschles !

@zroubalik zroubalik merged commit 89d8663 into kedacore:main Nov 10, 2021
@arschles
Copy link
Contributor Author

@arschles I do not have a very deep understanding of KEDA's codebase, but LGTM :)

@jerbob92 not a problem, and thank you for looking

thanks @arschles !

@zroubalik my pleasure. thanks for the review

@arschles arschles deleted the buildscaler-context branch November 10, 2021 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve context propagation to Scalers
3 participants