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

Rename scheduler/nodeinfo pkg to scheduler/types #89703

Merged
merged 1 commit into from Apr 2, 2020

Conversation

ahg-g
Copy link
Member

@ahg-g ahg-g commented Mar 31, 2020

What type of PR is this?

/kind cleanup

What this PR does / why we need it:
renames pkg/scheduler/nodeinfo to pkg/scheduler/types. This is in preparation to introduce a new type to the scheduler named PodInfo which will be placed in this new package.

Which issue(s) this PR fixes:
Part of #89528

Does this PR introduce a user-facing change?:

NONE

/assign @alculquicondor

@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. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Mar 31, 2020
@k8s-ci-robot k8s-ci-robot added area/e2e-test-framework Issues or PRs related to refactoring the kubernetes e2e test framework area/test sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Mar 31, 2020
@ahg-g
Copy link
Member Author

ahg-g commented Mar 31, 2020

/assign @msau42

Michelle can you please help approve the test related changes? this is just renaming a scheduler package.

@@ -31,7 +31,7 @@ import (
extenderv1 "k8s.io/kube-scheduler/extender/v1"
schedulerapi "k8s.io/kubernetes/pkg/scheduler/apis/config"
"k8s.io/kubernetes/pkg/scheduler/listers"
schedulernodeinfo "k8s.io/kubernetes/pkg/scheduler/nodeinfo"
schedulertypes "k8s.io/kubernetes/pkg/scheduler/types"
Copy link
Member

Choose a reason for hiding this comment

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

we don't need this alias in a pkg/scheduler package. Same for the rest of the imports that don't have collisions and are within pkg/scheduler.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a significant refactor, which I tried to automate, it will be too much work to select the places where this conflicts and where it doesn't, and the return is not obvious. The alias type is mostly used to refer to the apimachinary one. We also used schedulerlisters, so this is not diverging too much.

for _, c := range pod.Spec.Containers {
resPtr.Add(c.Resources.Requests)

non0CPUReq, non0MemReq := schedutil.GetNonzeroRequests(&c.Resources.Requests)
Copy link
Member

Choose a reason for hiding this comment

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

For a followup: This package shouldn't depend in other pkg/scheduler packages.
It looks like this function could be moved to this package https://sourcegraph.com/github.com/kubernetes/kubernetes@master/-/blob/pkg/scheduler/util/non_zero.go#L41:6&tab=references except for some import done in test/e2e/scheduling, which should go away according to #74352

Copy link
Member Author

@ahg-g ahg-g Mar 31, 2020

Choose a reason for hiding this comment

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

yes, that will certainly make sense especially when we have the pod_info.go file in this package.

@alculquicondor
Copy link
Member

/lgtm
my comments are nits

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 31, 2020
@ahg-g
Copy link
Member Author

ahg-g commented Mar 31, 2020

/retest

@@ -190,7 +190,7 @@
"k8s.io/kubernetes/pkg/scheduler/internal/parallelize",
"k8s.io/kubernetes/pkg/scheduler/listers",
"k8s.io/kubernetes/pkg/scheduler/metrics",
"k8s.io/kubernetes/pkg/scheduler/nodeinfo",
"k8s.io/kubernetes/pkg/scheduler/types",
Copy link
Member

Choose a reason for hiding this comment

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

It looks like you can't simply remove nodeinfo due to the dependency chain: e2e/framework -> kubemark -> kubelet -> scheduler

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, I just added it back.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 31, 2020
@alculquicondor
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 31, 2020
@msau42
Copy link
Member

msau42 commented Mar 31, 2020

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahg-g, msau42

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 Mar 31, 2020
@ahg-g
Copy link
Member Author

ahg-g commented Mar 31, 2020

/retest

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 31, 2020
@k8s-ci-robot k8s-ci-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Apr 1, 2020
@ahg-g
Copy link
Member Author

ahg-g commented Apr 1, 2020

/retest

@alculquicondor
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 2, 2020
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit e8a24cb into kubernetes:master Apr 2, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Apr 2, 2020
@ahg-g ahg-g deleted the ahg-podinfo branch October 25, 2021 14:43
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. area/e2e-test-framework Issues or PRs related to refactoring the kubernetes e2e test framework area/test 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. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. sig/testing Categorizes an issue or PR as relevant to SIG Testing. 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.

None yet

5 participants