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

Use consts as predicate key names in handlers #59952

Merged
merged 1 commit into from Feb 22, 2018

Conversation

Projects
None yet
5 participants
@resouer
Member

resouer commented Feb 15, 2018

What this PR does / why we need it:

Per discussion in: https://github.com/kubernetes/kubernetes/pull/59335/files#r168351460

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #59951

Special notes for your reviewer:

Release note:

Use consts as predicate name in handlers

@k8s-ci-robot k8s-ci-robot requested review from davidopp and timothysc Feb 15, 2018

@resouer resouer requested review from bsalamat and removed request for timothysc and davidopp Feb 16, 2018

@k82cn

This comment has been minimized.

Member

k82cn commented Feb 16, 2018

/lgtm
/approve

@k82cn

This comment has been minimized.

Member

k82cn commented Feb 16, 2018

/approve

// checkServiceAffinityPred defines the name of predicate checkServiceAffinity.
checkServiceAffinityPred = "checkServiceAffinity"
// CheckServiceAffinityPred defines the name of predicate checkServiceAffinity.
CheckServiceAffinityPred = "CheckServiceAffinity"

This comment has been minimized.

@k82cn

k82cn Feb 16, 2018

Member

will that introduce backward compatibility?

This comment has been minimized.

@resouer

resouer Feb 16, 2018

Member

Should be fine. According to: https://github.com/kubernetes/kubernetes/blob/master/pkg/scheduler/factory/plugins.go#L207-L218
The name of this predicate is not part of scheduler policy configure file.

This comment has been minimized.

@bsalamat

bsalamat Feb 17, 2018

Contributor

But there could be existing policy config files that are already using the old name.

This comment has been minimized.

@resouer

resouer Feb 22, 2018

Member

@bsalamat @k82cn AFAIK, the right way of using serviceAffinity in policy file is like below:

    "apiVersion": "v1",
    "kind": "Policy",
    "predicates": [
        {
            "name": "NoVolumeZoneConflict"
        },
        {
            "name": "MaxEBSVolumeCount"
        },
        {
            "name": "MaxGCEPDVolumeCount"
        },
        {
            "name": "MatchInterPodAffinity"
        },
        {
            "name": "NoDiskConflict"
        },
        {
            "name": "GeneralPredicates"
        },
        {
            "name": "PodToleratesNodeTaints"
        },
        {
            "name": "CheckNodeMemoryPressure"
        },
        {
            "name": "CheckNodeDiskPressure"
        },
        {
            "argument": {
                "serviceAffinity": {
                    "labels": [
                        "region"
                    ]
                }
            },
            "name": "Region"
        }
    ],

That's why I claim

The name of this predicate is not part of scheduler policy configure file

Since serviceAffinity is a argument which is not touched by this PR.

Correct me if I misunderstood sth :)

This comment has been minimized.

@bsalamat

bsalamat Feb 22, 2018

Contributor

Ah, I see. Thanks for clarification.

@k82cn

This comment has been minimized.

Member

k82cn commented Feb 16, 2018

/lgtm cancel

@k82cn

This comment has been minimized.

Member

k82cn commented Feb 16, 2018

overall, it's LGTM, just want to make sure it's ok with compatibility :)

@bsalamat

This comment has been minimized.

Contributor

bsalamat commented Feb 22, 2018

/lgtm

@k8s-ci-robot

This comment has been minimized.

Contributor

k8s-ci-robot commented Feb 22, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bsalamat, resouer

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-merge-robot

This comment has been minimized.

Contributor

k8s-merge-robot commented Feb 22, 2018

/test all [submit-queue is verifying that this PR is safe to merge]

@resouer

This comment has been minimized.

Member

resouer commented Feb 22, 2018

/retest

@k8s-merge-robot

This comment has been minimized.

Contributor

k8s-merge-robot commented Feb 22, 2018

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-merge-robot k8s-merge-robot merged commit a195a76 into kubernetes:master Feb 22, 2018

12 of 13 checks passed

Submit Queue Required Github CI test is not green: pull-kubernetes-e2e-gce
Details
cla/linuxfoundation resouer authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-cross Skipped
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gke Skipped
pull-kubernetes-e2e-kops-aws Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce Job succeeded.
Details
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-unit Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details

@resouer resouer deleted the resouer:consts-handler branch Feb 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment