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

cluster-autoscaler: standardize context usage #7664

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jackfrancis
Copy link
Contributor

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

This PR standardizes CA-specific context usage of the "k8s.io/autoscaler/cluster-autoscaler/context" library.

Specifically:

  • Standardize the import reference to ca_context to disambiguate from the standard golang "context" package.
    • e.g., ca_context "k8s.io/autoscaler/cluster-autoscaler/context"
  • Standardize variable references to type AutoscalingContext in functions, etc, as autoscalingContext (again, to disambiguate from the standard context foo)
  • Undo any non-idiomatic usage of the standard golang "context" package
    • e.g., we always import as "context", and never with an alias
    • e.g., we always use ctx as the variable reference to a context.Context type

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added 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. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. area/cluster-autoscaler labels Jan 6, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jackfrancis
Once this PR has been reviewed and has the lgtm label, please assign towca 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

@jackfrancis
Copy link
Contributor Author

/assign @MaciekPytel @towca

While reviewing some other PRs this stuff was driving me nuts. I think this PR, while pretty huge, improves the way we use context(s) significantly and isn't too horrible to review.

@jackfrancis
Copy link
Contributor Author

/test ls

@k8s-ci-robot
Copy link
Contributor

@jackfrancis: The specified target(s) for /test were not found.
The following commands are available to trigger optional jobs:

/test pull-cluster-autoscaler-e2e-azure-master
/test pull-kubernetes-e2e-autoscaling-vpa-full

In response to this:

/test ls

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.

@jackfrancis
Copy link
Contributor Author

/test pull-cluster-autoscaler-e2e-azure-master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cluster-autoscaler 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. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants