Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

retain healthCheckNodePort for service when updating #1347

Merged
merged 2 commits into from
Jan 18, 2021

Conversation

mars1024
Copy link
Contributor

Signed-off-by: Bruce Ma brucema19901024@gmail.com

What this PR does / why we need it:
For services which type==LoadBalancer and externalTrafficPolicy==Local, their field spec.healthCheckNodePort will be allocated by APIServer, and after that it should be unchangeable, so we should retain this field during update, just like spec.clusterIP and nodePort in ports.

Here we don't need to check whether the desired service need healthCheckNodePort but just pass it on, because if the passed healthCheckNodePort is not needed any more, it will be recycled by APIServer.

Special notes for your reviewer:
Codes in kubernetes about the validation on spec.healthCheckNodePort, https://github.com/kubernetes/kubernetes/blob/68108c70e29a74bb455ab63adeb5725a37e94e4f/pkg/registry/core/service/storage/rest.go#L369

Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 14, 2021
@makkes
Copy link
Contributor

makkes commented Jan 14, 2021

CI is failing with

docker: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit.

@makkes
Copy link
Contributor

makkes commented Jan 14, 2021

I just restarted the build. Let's hope for the best.

@hectorj2f
Copy link
Contributor

@mars1024 Could you add one unit test for this change ?

Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 18, 2021
@mars1024
Copy link
Contributor Author

@mars1024 Could you add one unit test for this change ?

Of course! I added some unit tests for this.

Copy link
Contributor

@hectorj2f hectorj2f 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 Indicates that a PR is ready to be merged. label Jan 18, 2021
@hectorj2f
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hectorj2f, mars1024

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 Jan 18, 2021
@k8s-ci-robot k8s-ci-robot merged commit ea5b34a into kubernetes-retired:master Jan 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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. lgtm Indicates that a PR is ready to be merged. 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.

None yet

4 participants