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

pass existing context without using TODO() #728

Merged
merged 1 commit into from
May 6, 2024

Conversation

googs1025
Copy link
Member

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

  • Solve TODO, pass existing context without using TODO()
  • fix typo

Which issue(s) this PR fixes:

Fixes #
None

Special notes for your reviewer:

None

Does this PR introduce a user-facing change?

None

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 5, 2024
@k8s-ci-robot k8s-ci-robot requested review from PiotrProkop and Tal-or May 5, 2024 01:29
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 5, 2024
Copy link

netlify bot commented May 5, 2024

Deploy Preview for kubernetes-sigs-scheduler-plugins canceled.

Name Link
🔨 Latest commit f3cd486
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-scheduler-plugins/deploys/663830515d63e30008050c5c

Copy link
Contributor

@Huang-Wei Huang-Wei left a comment

Choose a reason for hiding this comment

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

Thanks @googs1025 . Could you also fix context.Background() in non-test code? (we can fix tests later)

pkg/capacityscheduling/capacity_scheduling.go
140:	elasticQuotaInformer, err := dynamicCache.GetInformer(context.Background(), &v1alpha1.ElasticQuota{})
705:		if err := c.client.List(context.Background(), &eqList, client.InNamespace(pod.Namespace)); err != nil {

pkg/noderesourcetopology/cache/overreserve.go
67:	if err := client.List(context.Background(), nrtObjs); err != nil {
229:		if err := ov.client.Get(context.Background(), types.NamespacedName{Name: nodeName}, nrtCandidate); err != nil {

pkg/noderesourcetopology/podprovider/podprovider.go
47:	ctx := context.Background()

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 6, 2024
@googs1025
Copy link
Member Author

Thanks @googs1025 . Could you also fix context.Background() in non-test code? (we can fix tests later)

pkg/capacityscheduling/capacity_scheduling.go
140:	elasticQuotaInformer, err := dynamicCache.GetInformer(context.Background(), &v1alpha1.ElasticQuota{})
705:		if err := c.client.List(context.Background(), &eqList, client.InNamespace(pod.Namespace)); err != nil {

pkg/noderesourcetopology/cache/overreserve.go
67:	if err := client.List(context.Background(), nrtObjs); err != nil {
229:		if err := ov.client.Get(context.Background(), types.NamespacedName{Name: nodeName}, nrtCandidate); err != nil {

pkg/noderesourcetopology/podprovider/podprovider.go
47:	ctx := context.Background()

done. I have also made changes to some related test cases.
ctx is passed from the outermost layer.

Copy link
Contributor

@Huang-Wei Huang-Wei left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 6, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: googs1025, Huang-Wei

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

The pull request process is described 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 k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 6, 2024
@k8s-ci-robot k8s-ci-robot merged commit 521dd8e into kubernetes-sigs:master May 6, 2024
10 checks passed
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/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

3 participants