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

refactor(scheduler): replace init methods with constructor functions #905

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

Conversation

yxxhero
Copy link
Contributor

@yxxhero yxxhero commented Mar 1, 2025

What type of PR is this?
/kind bug

What this PR does / why we need it:

avoid literal copies lock value from

Which issue(s) this PR fixes:
This pull request simplifies the initialization of nodeManager and podManager by replacing the init methods with constructors. Additionally, it updates the Scheduler struct to use pointers for these managers and modifies the related tests accordingly.

Initialization improvements:

  • pkg/scheduler/nodes.go: Replaced the init method with a newNodeManager constructor to initialize the nodeManager struct.
  • pkg/scheduler/pods.go: Replaced the init method with a newPodManager constructor to initialize the podManager struct.

Scheduler struct updates:

  • pkg/scheduler/scheduler.go: Updated the Scheduler struct to use pointers for nodeManager and podManager, and modified the NewScheduler function to use the new constructors. [1] [2]

Test updates:

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

@hami-robott hami-robott bot added kind/bug Something isn't working dco-signoff: yes size/M labels Mar 1, 2025
@hami-robott hami-robott bot requested review from archlitchi and wawa0210 March 1, 2025 01:45
Copy link
Contributor

hami-robott bot commented Mar 1, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: yxxhero
Once this PR has been reviewed and has the lgtm label, please assign archlitchi for approval. For more information see the Kubernetes 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

@yxxhero
Copy link
Contributor Author

yxxhero commented Mar 1, 2025

@archlitchi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant