Commit Graph

28970 Commits (187ef17ed8652b082558fad30d988e0b7ddb91e4)

Author SHA1 Message Date
Kubernetes Submit Queue ff7abf2705
Merge pull request #63649 from dixudx/kubectl_flags_binding
Automatic merge from submit-queue (batch tested with PRs 63761, 63794, 63649). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix missing flag value bindings in kubectl

**What this PR does / why we need it**:
When working #63644, I find there are still some flag not bound correctly.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
xref #60366

**Special notes for your reviewer**:
/cc soltysh deads2k 
/cc kubernetes/sig-cli-api-reviews 
**Release note**:

```release-note
None
```
2018-05-14 07:59:11 -07:00
Kubernetes Submit Queue 1b1defb060
Merge pull request #63794 from hzxuzhonghu/tmp-5-14
Automatic merge from submit-queue (batch tested with PRs 63761, 63794, 63649). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove unused PrintFlags.Scheme

PrintFlags.Scheme is unused, remove it.

**Release note**:

```release-note
NONE
```
2018-05-14 07:59:08 -07:00
Kubernetes Submit Queue d5a930bed4
Merge pull request #63761 from liggitt/aggregated-bootstrap-race
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Avoid copying aggregated admin/edit/view roles during bootstrap

Fixes #63760

At apiserver startup, prior to reconciling cluster roles, the following roles (if they exist) are copied:
* admin -> system:aggregate-to-admin
* edit -> system:aggregate-to-edit
* view -> system:aggregate-to-view

This was added in 1.9 as part of role aggregation to ensure custom permissions added to the admin/edit/view roles were preserved, prior to making the admin/edit/view roles aggregated (since the permissions of an aggregated role are controller-managed)

When starting multiple members of a new HA cluster simultaneously, the following race can occur:
* t=0, server 1,2,3 start up
* t=1, server 1 finds no admin/edit/view roles exist, begins role reconciliation and creates the aggregated `admin` role
* t=2, server 2 finds and copies the `admin` role created by server 1 to `system:aggregate-to-admin`

If this race is encountered, it results in `system:aggregate-to-admin` being an aggregated role, and its permissions subject to being overwritten by the aggregating controller. To prevent this from happening, the permission-preserving copy should only copy over roles that are not yet aggregated.

To correct this in clusters that have already encountered it, role reconciliation should remove aggregation from a role that is not expected to be aggregated at all.

```release-note
corrects a race condition in bootstrapping aggregated cluster roles in new HA clusters
```
2018-05-14 07:34:41 -07:00
xuzhonghu 7e4014e02b remove unused PrintFlags.Scheme 2018-05-14 20:49:19 +08:00
Kubernetes Submit Queue e34df0a26c
Merge pull request #63585 from islinwb/ipset_comment
Automatic merge from submit-queue (batch tested with PRs 62833, 63585). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add comments for ipset entries in kube-proxy

**What this PR does / why we need it**:

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #63584 

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-14 00:49:05 -07:00
Di Xu e8ef744493 fix missing flag value bindings in kubectl 2018-05-14 14:38:54 +08:00
Kubernetes Submit Queue e24fd8efb1
Merge pull request #62040 from ianychoi/korean-translation
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Adds initial Korean translations for kubectl

**What this PR does / why we need it**:
This PR provides a first attempt to translate kubectl in Korean (related to #51867, #40645, #45573, #45562, #40591, #46559, #50155).

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
No issues

**Special notes for your reviewer**:
This PR requires Korean people to assist in the review. I am native in Korean and also a translator & reviewer in Korean in OpenStack I18n team (http://stackalytics.com/?metric=translations&user_id=ianychoi ).

**Release note**:
```release-note
Adding initial Korean translation for kubectl
```
2018-05-13 22:27:40 -07:00
Kubernetes Submit Queue 9f7348ed50
Merge pull request #63230 from WanLinghao/sa_util_fix
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

clean duplicate test function

**What this PR does / why we need it**:
As the patch shows, the function it tests has been moved to 
b87a392b1a/staging/src/k8s.io/apiserver/pkg/authentication/serviceaccount/util.go (L43)
 The make/split function has been tested on file b87a392b1a/staging/src/k8s.io/apiserver/pkg/authentication/serviceaccount/util_test.go (L21)

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-13 20:07:24 -07:00
Jordan Liggitt a674335ccc
Avoid copying aggregated admin/edit/view roles during bootstrap 2018-05-13 15:21:05 -04:00
Kubernetes Submit Queue c9b56e6a7a
Merge pull request #63582 from WanLinghao/sa_var_clean
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

clean unused variables on serviceaccounts_controller_test.go

**What this PR does / why we need it**:
this patch simply removes unused variables 
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-11 20:00:05 -07:00
Ian Y. Choi 856110a21c Adds initial Korean translations for kubectl 2018-05-12 11:16:49 +09:00
Kubernetes Submit Queue f7ccaae269
Merge pull request #63686 from dougm/deprecate-photon
Automatic merge from submit-queue (batch tested with PRs 63686, 63736). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Deprecate photon cloud provider

vmware/photon-controller is no longer maintained, as of Oct 2017.

Adds a detail field to deprecatedCloudProviders, meant for pointing to external provider url or other reason for deprecation.



**What this PR does / why we need it**:

The photon cloud provider is no longer supported, need to let users know.

Photon controller support has already been removed from kube-up in PR #58096

**Release note**:

```release-note
NONE
```
2018-05-11 19:09:15 -07:00
Kubernetes Submit Queue 6017f6daef
Merge pull request #63170 from micahhausler/node-ip-fix
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Report node DNS info with --node-ip

**What this PR does / why we need it**:
This PR adds `ExternalDNS`, `InternalDNS`, and `ExternalIP` info for kubelets with the `--nodeip` flag enabled. 

**Which issue(s) this PR fixes** 
Fixes #63158

**Special notes for your reviewer**:

I added a field to the Kubelet to make IP validation more testable (`validateNodeIP` relies on the `net` package and the IP address of the host that is executing the test.) I also converted the test to use a table so new cases could be added more easily.

**Release Notes**
```release-note
Report node DNS info with --node-ip flag
```

@andrewsykim
@nckturner 

/sig node
/sig network
2018-05-11 15:46:35 -07:00
Kubernetes Submit Queue 5782d476c5
Merge pull request #63720 from dims/log-error-for-compute-v2-api
Automatic merge from submit-queue (batch tested with PRs 63367, 63718, 63446, 63723, 63720). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

log error for os.NewComputeV2

**What this PR does / why we need it**:

Since we are returning false, we are kind of losing the error message,
so we should at least log it.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Related to https://github.com/kubernetes/cloud-provider-openstack/issues/169

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-11 14:49:22 -07:00
Kubernetes Submit Queue 92ba95c39c
Merge pull request #63446 from deads2k/client-08-remove-old
Automatic merge from submit-queue (batch tested with PRs 63367, 63718, 63446, 63723, 63720). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

finish new dynamic client and deprecate old dynamic client

Builds on a couple other pulls.  This completes the transition to the new dynamic client.

@kubernetes/sig-api-machinery-pr-reviews 
@caesarxuchao @sttts 

```release-note
The old dynamic client has been replaced by a new one.  The previous dynamic client will exist for one release in `client-go/deprecated-dynamic`.  Switch as soon as possible.
```
2018-05-11 14:49:16 -07:00
Kubernetes Submit Queue ec8db4e266
Merge pull request #63367 from juanvallejo/jvallejo/fail-printing-on-internal-obj-given
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fail printing on internal obj

**Release note**:
```release-note
NONE
```

Returns an error on `PrintObj` methods if an internal object is given.

cc @deads2k @soltysh
2018-05-11 14:21:18 -07:00
Doug MacEachern f8ac0c4d41 Deprecate photon cloud provider
vmware/photon-controller is no longer maintained, as of Oct 2017.

Adds a detail field to deprecatedCloudProviders, meant for pointing to external provider url or other reason for deprecation.
2018-05-11 13:18:05 -07:00
juanvallejo b5f6d834fc fail printing on internal obj 2018-05-11 14:54:37 -04:00
Kubernetes Submit Queue 204520b029
Merge pull request #63344 from RobertKrawitz/fix-process-kill-algorithm
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Correct kill logic for pod processes

Correct the kill logic for processes in the pod's cgroup.  os.FindProcess() does not check whether the process exists on POSIX systems.
2018-05-11 11:41:19 -07:00
Kubernetes Submit Queue 5a54555f59
Merge pull request #63049 from andrewsykim/kcm-nodeipam
Automatic merge from submit-queue (batch tested with PRs 63049, 59731). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

re-enable nodeipam in kube-controller-manager

**What this PR does / why we need it**:
Re-enables nodeipam controller for external clouds. Also does a small refactor so that we don't need to pass in `allocateNodeCidr` into the controller. 

In v1.10 we made a change (9187b343e1 (diff-f11913dc67d80d36b3d06a93f61c49cf) in https://github.com/kubernetes/kubernetes/pull/57492) where nodeipam would be disabled for any cluster that sets `--cloud-provider=external`. The original intention behind this was that the nodeipam controller is cloud specific for some clouds (only GCE at the moment) so it should be moved to the CCM (cloud controller manager). After some discussions with wg-cloud-provider it makes sense to re-enable nodeipam controller in KCM and have GCE CCM enable its own cloud-specific IPAM controller as part of [Initialize()](https://github.com/kubernetes/kubernetes/blob/master/pkg/cloudprovider/cloud.go#L33-L35). This would allow for GCE to run nodeipam in both KCM (by setting --cloud-provider=gce and --allocate-node-cidr) and in the CCM (once implemented in `Initialize()`) without disabling nodeipam in the KCM for all external clouds and avoids having to implement nodeipam in CCM. 

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes # 

**Special notes for your reviewer**:


**Release note**:
```release-note
Re-enable nodeipam controller for external clouds. 
```
2018-05-11 11:07:12 -07:00
Davanum Srinivas 2080de6adc log error for os.NewComputeV2
Since we are returning false, we are kind of losing the error message,
so we should at least log it.
2018-05-11 13:39:18 -04:00
David Eads fd044d152e fix dynamic client name 2018-05-11 13:12:09 -04:00
David Eads d8924bc1c9 move old dynamic client to deprecated-client 2018-05-11 08:00:46 -04:00
David Eads 1fd4149ed4 update describer to use dynamic client 2018-05-11 07:59:08 -04:00
Weibin Lin 10664ee8c6 Add comments for ipset entries in kube-proxy 2018-05-11 17:11:34 +08:00
Kubernetes Submit Queue 7eb88f11d2
Merge pull request #59727 from wgliang/master.time
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

should use time.Since instead of time.Now().Sub

**What this PR does / why we need it**:
should use time.Since instead of time.Now().Sub

**Special notes for your reviewer**:
2018-05-10 20:29:40 -07:00
Kubernetes Submit Queue 8d80d5df59
Merge pull request #63685 from nicksardo/patch-bs
Automatic merge from submit-queue (batch tested with PRs 62244, 63685). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

GCE: Add Patch method to GA Backend Services

**What this PR does / why we need it**:
Generates the Patch API call for GA Backend Services.

**Special notes for your reviewer**:
/cc @rramkumar1 

**Release note**:
```release-note
NONE
```
2018-05-10 16:30:10 -07:00
Kubernetes Submit Queue 6203b621ba
Merge pull request #62244 from CaoShuFeng/raw
Automatic merge from submit-queue (batch tested with PRs 62244, 63685). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix "kubectl create --raw"

Before this change:
```
$ kubectl create -f  pod.json --raw=https://172.16.29.130:443/api/v1/namespaces/default/pods  --as=tom --as-group=aaaaa
Error from server (Forbidden): unknown
```

After this change:
```
$ kubectl create -f pod.json --raw=https://172.16.29.130:443/api/v1/namespaces/default/pods  --as=tom --as-group=aaaaa
Error from server (Forbidden): pods is forbidden: User "tom" cannot create pods in the namespace "default"
```

/assign @soltysh 
**Release note**:

```release-note
NONE
```
2018-05-10 16:30:07 -07:00
Kubernetes Submit Queue 143d3b8824
Merge pull request #63561 from juanvallejo/jvallejo/make-opinionated-print-flags-constructor
Automatic merge from submit-queue (batch tested with PRs 63669, 63511, 63561, 63289). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove legacyscheme dep from printFlags

**Release note**:
```release-note
NONE
```

Breaks PrintFlags dependency on legacyscheme
Prerequisite to https://github.com/kubernetes/kubernetes/pull/63402

cc @deads2k @soltysh
2018-05-10 14:25:16 -07:00
Kubernetes Submit Queue 4868d7775a
Merge pull request #63511 from juanvallejo/jvallejo/cmd-cleanup
Automatic merge from submit-queue (batch tested with PRs 63669, 63511, 63561, 63289). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

cleanup TODOs from PrintFlags wiring

**Release note**:
```release-note
NONE
```

Address TODOs from PrintFlags wiring

cc @soltysh @deads2k
2018-05-10 14:25:13 -07:00
Nick Sardo 81a5fa431c Add Patch method to GA Backend Services 2018-05-10 12:45:21 -07:00
juanvallejo 40e52bf07d remove legacyscheme dep from printFlags 2018-05-10 14:51:12 -04:00
David Eads 16d6a6c52f move resource builder to generic options 2018-05-10 14:15:12 -04:00
juanvallejo 7b1b107ea4 cleanup TODO comments from PrintFlags wiring 2018-05-10 14:03:06 -04:00
David Eads 76d744efe9 remove kube/kube deps from resourcebuilder 2018-05-10 12:50:28 -04:00
Kubernetes Submit Queue 7e75a09db6
Merge pull request #63613 from deads2k/cli-52-builderclient
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

 construct resource.Builder from kubeconfig flags

updates the resource.Builder to be constructed from the kubeconfig flags struct/interface that we now have.

@kubernetes/sig-cli-maintainers 
@juanvallejo @soltysh 

```release-note
NONE
```
2018-05-10 09:03:11 -07:00
Kubernetes Submit Queue 321201f672
Merge pull request #63406 from derekwaynecarr/label-pod-cgroups
Automatic merge from submit-queue (batch tested with PRs 60200, 63623, 63406). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Apply pod name and namespace labels for pod cgroup for cadvisor metrics

**What this PR does / why we need it**:
1. Enable Prometheus users to determine usage by pod name and namespace for pod cgroup sandbox.
1. Label cAdvisor metrics for pod cgroups by pod name and namespace.
1. Aligns with kubelet stats summary endpoint pod cpu and memory stats.

**Special notes for your reviewer**:
This provides parity with the summary API enhancements done here:
https://github.com/kubernetes/kubernetes/pull/55969

**Release note**:
```release-note
Apply pod name and namespace labels to pod cgroup in cAdvisor metrics
```
2018-05-10 08:33:11 -07:00
David Eads 080d6a4b0d wrap restclientgetter with match version option 2018-05-10 09:43:22 -04:00
David Eads 1f5357034b construct resource.Builder from kubeconfig flags 2018-05-10 09:42:15 -04:00
Kubernetes Submit Queue f321613dad
Merge pull request #63424 from xiaoxubeii/issue-63183-master
Automatic merge from submit-queue (batch tested with PRs 63424, 63657). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix #63183 Pods on different nodes mount Ceph RBD PVC stuck on ContainerCreating

**What this PR does / why we need it**:
Ceph/RBD pvc can be attached on different nodes when use ReadOnlyMany.


**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #63183

**Special notes for your reviewer**:

**Release note**:

```release-note
None
```
2018-05-10 06:31:16 -07:00
Kubernetes Submit Queue 0ba80021c5
Merge pull request #56690 from redbaron/master
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Disable session affinity for internal kuberntes service

Under following conditions session affinity leads to a deadlock:
  - Self hosted controller-manager, where it talks to API servers
    via kubernetes service ClusterIP
  - default master-count reconcilier is used
  - --apiserver-count is set to >1 according to the help message
  - number of responsive APIServers goes below `apiserver-count`
  - all controller-managers happen to be hashed to APIServers which
    are down.

What then happens is that controller managers never be able to
contact APIServer, despite correctly working APIServer available.

Less serious outages also possible for other consumers of kubernetes
service, such as operators, kube-dns, flannel & calico, etc.  There is
always non zero chance, that given consumer is hashed  to an apiserver
which is down.

This reverts PR https://github.com/kubernetes/kubernetes/pull/23129

/sig api-machinery
CCing:
  -  author and approver of reverted PR: @mikedanese, @lavalamp 
  - other affected users which spoke up: @jsravn, @tatsuhiro-t 


```release-note
NONE
```
2018-05-10 04:20:40 -07:00
Kubernetes Submit Queue d42df4561a
Merge pull request #61976 from atlassian/ticker-with-stop
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Stop() for Ticker to enable leak-free code

**What this PR does / why we need it**:
I wanted to use the clock package but the `Ticker` without a `Stop()` method is a deal breaker for me.

**Release note**:
```release-note
NONE
```
/kind enhancement
/sig api-machinery
2018-05-09 19:06:56 -07:00
WanLinghao c68a11d042 remove unused variables on
pkg/controller/serviceaccount/serviceaccounts_controller_test.go
	pkg/controller/endpoint/endpoints_controller_test.go
2018-05-10 09:19:00 +08:00
Kubernetes Submit Queue b2fe2a0a6d
Merge pull request #59847 from mtaufen/dkcfg-explicit-keys
Automatic merge from submit-queue (batch tested with PRs 63624, 59847). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

explicit kubelet config key in Node.Spec.ConfigSource.ConfigMap

This makes the Kubelet config key in the ConfigMap an explicit part of
the API, so we can stop using magic key names.
    
As part of this change, we are retiring ConfigMapRef for ConfigMap.


```release-note
You must now specify Node.Spec.ConfigSource.ConfigMap.KubeletConfigKey when using dynamic Kubelet config to tell the Kubelet which key of the ConfigMap identifies its config file.
```
2018-05-09 17:55:13 -07:00
Kubernetes Submit Queue 8de6600a55
Merge pull request #63539 from wojtek-t/refactor_secret_configmap_manager
Automatic merge from submit-queue (batch tested with PRs 63593, 63539). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Refactor cachingSecretManager

I have a POC of watch-based implementation of SecretManager in https://github.com/kubernetes/kubernetes/pull/63461

This is an initial refactoring that would make that change easier.

@yujuhong - if you're fine with this PR, I will do the same for configmaps in the follow up PR.
2018-05-09 14:49:14 -07:00
Kubernetes Submit Queue ca92b73a65
Merge pull request #63602 from deads2k/cli-54-categories
Automatic merge from submit-queue (batch tested with PRs 59284, 63602). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

 category expansion can only come from the server

A couple release ago we moved category expansion to the server instead of hardcoding it in the client.  Similar to restmappings, there is no valid client-side expansion anymore, so this removes the code that hardcoded the list and moves the category expansion to the same package as our discovery based restmappers.

@kubernetes/sig-cli-maintainers 

```release-note
NONE
```
2018-05-09 13:51:13 -07:00
Kubernetes Submit Queue d89471c4b5
Merge pull request #59284 from Addepar/fix-empty-null-patch
Automatic merge from submit-queue (batch tested with PRs 59284, 63602). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Exclude keys containing empty patches in the final patch

**What this PR does / why we need it**: 
This minimizes the 3-way JSON merge patch generated when calculating the patch necessary to send to the server. It does this by removing empty maps created from deleting keys in the keepOrDeleteNullInObj method.

This is not only a slight performance improvement (less PATCH requests) but also necessary when working with custom resources that have RBAC restrictions.

**Which issue(s) this PR fixes**: N/A

**Special notes for your reviewer**: N/A

**Release note**:

```release-note
NONE
```
2018-05-09 13:51:09 -07:00
David Eads ad87219b2c category expansion can only come from the server 2018-05-09 15:05:58 -04:00
David Eads 37f6cb7230 move category expansion types to restmapper package 2018-05-09 15:03:09 -04:00
Kubernetes Submit Queue 23a9136d4e
Merge pull request #63599 from deads2k/cli-53-restmapper
Automatic merge from submit-queue (batch tested with PRs 63597, 63599). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

push ToRESTMapper down a layer

The RESTMapper is needed to drive some use-cases for a dynamic client and takes a little bit of wiring (nested restmappers).  This pull pushes that into information derived from the kubeconfig flags to allow easy re-use.

@kubernetes/sig-cli-maintainers 
/assign @juanvallejo 
/assign @soltysh 

assigned to original creators.


```release-note
NONE
```
2018-05-09 11:26:12 -07:00