k3s/pkg/registry
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
..
admissionregistration run hack/update-all 2017-06-22 11:31:03 -07:00
apps Autogen 2017-07-20 14:16:43 -07:00
authentication run hack/update-all 2017-06-22 11:31:03 -07:00
authorization run hack/update-all 2017-06-22 11:31:03 -07:00
autoscaling run hack/update-all 2017-06-22 11:31:03 -07:00
batch add cronjobs to all 2017-07-21 10:56:26 -04:00
cachesize Add PriorityClass API 2017-07-18 17:47:57 -07:00
certificates run hack/update-all 2017-06-22 11:31:03 -07:00
core Merge pull request #48418 from xiangpengzhao/refactor-create-svc 2017-07-22 02:05:21 -07:00
extensions bulk delete of tpr packages 2017-07-05 11:02:23 -04:00
networking add svc and netpol to discovery 2017-07-18 13:16:41 -04:00
policy run hack/update-all 2017-06-22 11:31:03 -07:00
rbac Ensure namespace exists as part of RBAC reconciliation 2017-07-04 18:24:16 -05:00
registrytest remove some people from OWNERS so they don't get reviews anymore 2017-07-13 10:02:21 -07:00
scheduling autogenerated files 2017-07-18 17:47:57 -07:00
settings run hack/update-all 2017-06-22 11:31:03 -07:00
storage run hack/update-all 2017-06-22 11:31:03 -07:00
BUILD autogenerated files 2017-07-18 17:47:57 -07:00
OWNERS remove some people from OWNERS so they don't get reviews anymore 2017-07-13 10:02:21 -07:00
doc.go