-
Notifications
You must be signed in to change notification settings - Fork 530
retain healthCheckNodePort for service when updating #1347
retain healthCheckNodePort for service when updating #1347
Conversation
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
CI is failing with
|
I just restarted the build. Let's hope for the best. |
@mars1024 Could you add one unit test for this change ? |
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
Of course! I added some unit tests for this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve |
[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 |
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 likespec.clusterIP
andnodePort
in ports.Here we don't need to check whether the desired service need
healthCheckNodePort
but just pass it on, because if the passedhealthCheckNodePort
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