k3s/pkg/registry/core
Kubernetes Submit Queue f26b2956fb Merge pull request #48418 from xiangpengzhao/refactor-create-svc
Automatic merge from submit-queue (batch tested with PRs 49409, 49352, 49266, 48418)

Use helper to init ClusterIP and NodePort in Create of service

**What this PR does / why we need it**:
Make service `Create` more readable and testable.

- use `initClusterIP` introduced in #46197 to init ClusterIP allocation in service `Create`
- add a new helper `initNodePort` to init NodePort allocation in service `Create`
- TBD: add test case for `initNodePort`. This will cover the NodePort allocation process in `Create`. If this PR makes sense, I will write a test case later.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #35354 (not directly. #35354 was fixed by #46197. The idea of this PR is from https://github.com/kubernetes/kubernetes/pull/46197#discussion_r120910077)

**Special notes for your reviewer**:
/cc @thockin @freehan 

**Release note**:

```release-note
NONE
```
2017-07-22 02:05:21 -07:00
..
componentstatus componentstatus: support client cert health check 2017-04-17 13:58:33 +08:00
configmap Grow signature for predicate attributes to include init status 2017-06-02 22:09:04 -04:00
endpoint Grow signature for predicate attributes to include init status 2017-06-02 22:09:04 -04:00
event allow a deletestrategy to opt-out of GC 2017-07-03 11:27:45 -04:00
limitrange Grow signature for predicate attributes to include init status 2017-06-02 22:09:04 -04:00
namespace Grow signature for predicate attributes to include init status 2017-06-02 22:09:04 -04:00
node generated: bazel / godeps 2017-07-09 15:23:34 -04:00
persistentvolume Grow signature for predicate attributes to include init status 2017-06-02 22:09:04 -04:00
persistentvolumeclaim Grow signature for predicate attributes to include init status 2017-06-02 22:09:04 -04:00
pod generated: bazel / godeps 2017-07-09 15:23:34 -04:00
podtemplate Grow signature for predicate attributes to include init status 2017-06-02 22:09:04 -04:00
rangeallocation Enable auto-generating sources rules 2017-01-05 14:14:13 -08:00
replicationcontroller Add group alias names to discovery in registry 2017-06-05 20:18:12 -03:00
resourcequota Grow signature for predicate attributes to include init status 2017-06-02 22:09:04 -04:00
rest componentstatus: support client cert health check 2017-04-17 13:58:33 +08:00
secret Grow signature for predicate attributes to include init status 2017-06-02 22:09:04 -04:00
service Merge pull request #48418 from xiangpengzhao/refactor-create-svc 2017-07-22 02:05:21 -07:00
serviceaccount Grow signature for predicate attributes to include init status 2017-06-02 22:09:04 -04:00
OWNERS Update OWNERS approvers and reviewers: pkg/registry 2016-12-19 16:22:40 -08:00