Skip to content

Scheduler:remove direct dependency for k8s.io/kubernetes/pkg/util/node and remove // TODO: prefer stable labels for zone in v1.18 #90040

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

Closed
wants to merge 1 commit into from

Conversation

tanjunchen
Copy link
Contributor

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Which issue(s) this PR fixes:

ref:#89930

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.:

None

@k8s-ci-robot k8s-ci-robot added 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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. 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 Apr 10, 2020
@k8s-ci-robot k8s-ci-robot requested review from k82cn and liu-cong April 10, 2020 05:33
@k8s-ci-robot k8s-ci-robot added sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 10, 2020
@tanjunchen
Copy link
Contributor Author

/priority backlog
/kind cleanup
/cc @damemi

@k8s-ci-robot k8s-ci-robot requested a review from damemi April 10, 2020 05:35
@k8s-ci-robot k8s-ci-robot added priority/backlog Higher priority than priority/awaiting-more-evidence. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Apr 10, 2020
@tanjunchen tanjunchen changed the title remove direct dependency for k8s.io/kubernetes/pkg/util/node Scheduler:remove direct dependency for k8s.io/kubernetes/pkg/util/node Apr 10, 2020
@tanjunchen
Copy link
Contributor Author

/test pull-kubernetes-e2e-gce
/cc @liggitt

@k8s-ci-robot k8s-ci-robot requested a review from liggitt April 14, 2020 05:45
@tanjunchen
Copy link
Contributor Author

/test pull-kubernetes-e2e-gce

Copy link
Member

@damemi damemi left a comment

Choose a reason for hiding this comment

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

this lgtm, but it would be nice in the future if we could find a way to have this function in a single external package that can be used by both the scheduler and nodelifecycle controller (that seems to be the only other place this function is used)

/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 15, 2020
return ""
}

// TODO: prefer stable labels for zone in v1.18
Copy link
Member

Choose a reason for hiding this comment

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

can just look at the stable labels. a 1.19 scheduler can depend on a 1.18+ controller, which ensures the stable labels exist and are synced with the beta labels.

Comment on lines 127 to 137
// TODO: prefer stable labels for zone in v1.18
zone, ok := labels[v1.LabelZoneFailureDomain]
if !ok {
zone, _ = labels[v1.LabelZoneFailureDomainStable]
}

// TODO: prefer stable labels for region in v1.18
region, ok := labels[v1.LabelZoneRegion]
if !ok {
region, _ = labels[v1.LabelZoneRegionStable]
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// TODO: prefer stable labels for zone in v1.18
zone, ok := labels[v1.LabelZoneFailureDomain]
if !ok {
zone, _ = labels[v1.LabelZoneFailureDomainStable]
}
// TODO: prefer stable labels for region in v1.18
region, ok := labels[v1.LabelZoneRegion]
if !ok {
region, _ = labels[v1.LabelZoneRegionStable]
}
zone := labels[v1.LabelZoneFailureDomainStable]
region := labels[v1.LabelZoneRegionStable]

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

liggitt commented Apr 16, 2020

/lgtm

scheduling team has approval

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

liggitt commented Apr 16, 2020

looks like unit tests need updating to stable labels

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 16, 2020
@tanjunchen tanjunchen changed the title Scheduler:remove direct dependency for k8s.io/kubernetes/pkg/util/node Scheduler:remove direct dependency for k8s.io/kubernetes/pkg/util/node and remove // TODO: prefer stable labels for zone in v1.18 Apr 16, 2020
@tanjunchen
Copy link
Contributor Author

/retest

Copy link
Contributor

@gavinfish gavinfish left a comment

Choose a reason for hiding this comment

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

/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 16, 2020
@tanjunchen
Copy link
Contributor Author

looks like unit tests need updating to stable labels

yes . i have updated it , could you review it again?

@liggitt
Copy link
Member

liggitt commented Apr 17, 2020

lgtm
/unassign
/assign @ahg-g

@k8s-ci-robot k8s-ci-robot assigned ahg-g and unassigned liggitt Apr 17, 2020
@tanjunchen
Copy link
Contributor Author

/cc @ahg-g

@@ -109,3 +109,25 @@ func GetPodAntiAffinityTerms(podAntiAffinity *v1.PodAntiAffinity) (terms []v1.Po
}
return terms
}

Copy link
Member

Choose a reason for hiding this comment

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

defaultpodtopologyspread will be deprecated soon, so add a todo to move this function to node_tree.go once this happens.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ahg-g
updated

@ahg-g
Copy link
Member

ahg-g commented Apr 23, 2020

On a second thought, there is no urgency to doing this, our plan is to deprecate the util pkg and so we shouldn't add anything to it. Also, what we should invest in is moving k8s.io/kubernetes/pkg/util/node pkg to staging instead of duplicating the code.

@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 24, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tanjunchen
To complete the pull request process, please assign ahg-g
You can assign the PR to them by writing /assign @ahg-g in a comment when ready.

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

…e and remove // TODO: prefer stable labels for zone in v1.18
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 17, 2020
@k8s-ci-robot
Copy link
Contributor

@tanjunchen: PR needs rebase.

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/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note-none Denotes a PR that doesn't merit a release note. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants