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

service controller: if targetPort has changed will process by cloud-p… #77712

Merged
merged 1 commit into from
Jun 22, 2019

Conversation

Sn0rt
Copy link
Contributor

@Sn0rt Sn0rt commented May 10, 2019

if targetPort is changed will process by service controller.

/kind feature

Fixes #77586

if targetPort is changed that will process by service controller 

in fact it's depend on Cloud Provider

/ok-to-test

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. 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-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 May 10, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @Sn0rt. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 10, 2019
@k8s-ci-robot k8s-ci-robot added sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/network Categorizes an issue or PR as relevant to SIG Network. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 10, 2019
@bowei
Copy link
Member

bowei commented May 10, 2019

/assign

@bowei
Copy link
Member

bowei commented May 10, 2019

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 10, 2019
@Sn0rt Sn0rt force-pushed the check-target-port-check branch 2 times, most recently from dca3023 to c2c0d71 Compare May 10, 2019 06:32
@Sn0rt
Copy link
Contributor Author

Sn0rt commented May 10, 2019

/retest

@Sn0rt
Copy link
Contributor Author

Sn0rt commented May 13, 2019

@bowei hi, can you help me to check this PR again ?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 1, 2019
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 6, 2019
@Sn0rt
Copy link
Contributor Author

Sn0rt commented Jun 6, 2019

/test pull-kubernetes-integration

@@ -568,8 +568,9 @@ func portEqualForLB(x, y *v1.ServicePort) bool {
return false
}

// We don't check TargetPort; that is not relevant for load balancing
// TODO: Should we blank it out? Or just check it anyway?
if !reflect.DeepEqual(x.TargetPort, y.TargetPort) {
Copy link
Member

Choose a reason for hiding this comment

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

I think you should be able to do:

if x.TargetPort != y.TargetPort

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the struct of targetPort is TargetPort intstr.IntOrString. and I saw that the author to check status change or not by reflect.DeepEqual in the other place of code.

Copy link
Member

Choose a reason for hiding this comment

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

It seems to be a struct of all non pointer types, so it should be straightforwardly comparable? Use of reflect is usually pretty heavyweight...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

reasonable, I will fix it.

@vllry
Copy link
Contributor

vllry commented Jun 18, 2019

/lgtm
/priority important-longterm

@k8s-ci-robot k8s-ci-robot added priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jun 18, 2019
@Sn0rt
Copy link
Contributor Author

Sn0rt commented Jun 18, 2019

/test pull-kubernetes-e2e-gce-100-performance

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 21, 2019
@bowei
Copy link
Member

bowei commented Jun 21, 2019

can we do the following in the test to make it less verbose and easier to read:

type serviceBuilder struct {
 object *v1.Service
}

func (sb *serviceBuilder) targetPort(v intstr) *serviceBuilder {
  sb.object = sb.object.DeepCopy()
  sb.object.Spec.Port[0].TargetPort = v
  return sb
}

// then your test case becomes

{
  ...
  updateFn: func() {
    oldSvc   = &v1.Service { ... }
    newSvc = &serviceBuilder{oldSvc}.targetPort(intstr.Parse("21")).object
  },
  expectedNeedsUpdate: true,
},

@Sn0rt
Copy link
Contributor Author

Sn0rt commented Jun 21, 2019

/test pull-kubernetes-integration

…rovider

Signed-off-by: guohaowang <wangguohao.2009@gmail.com>
@Sn0rt
Copy link
Contributor Author

Sn0rt commented Jun 21, 2019

/test pull-kubernetes-kubemark-e2e-gce-big

@bowei
Copy link
Member

bowei commented Jun 21, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 21, 2019
@bowei
Copy link
Member

bowei commented Jun 21, 2019

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bowei, Sn0rt

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 Jun 21, 2019
@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.

2 similar comments
@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.

@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 4b8a116 into kubernetes:master Jun 22, 2019
@Sn0rt Sn0rt deleted the check-target-port-check branch June 26, 2019 03:46
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/network Categorizes an issue or PR as relevant to SIG Network. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

if update the TargetPort can I set the item into service controller work enqueue ?
5 participants