Merge pull request #44612 from nikhita/fix-patch-crash

Automatic merge from submit-queue

Fix kube-apiserver crash when patching TPR data

**What this PR does / why we need it**: While trying to do a strategic merge patch, kube-apiserver crashes with a nil pointer dereference because `UnsafeConvertor` is `nil` for TPR data resources here: https://github.com/kubernetes/kubernetes/blob/master/pkg/master/thirdparty/thirdparty.go#L314-L337.

This PR does not make strategic merge patch work on TPR data but makes sure that the kube-api server does not crash while trying to do so.

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

**Special notes for your reviewer**:

**Release note**:

```
NONE
```
pull/6/head
Kubernetes Submit Queue 2017-05-16 01:48:15 -07:00 committed by GitHub
commit 2879b2cb84
1 changed files with 6 additions and 5 deletions

View File

@ -323,6 +323,7 @@ func (m *ThirdPartyResourceServer) thirdpartyapi(group, kind, version, pluralRes
Copier: api.Scheme,
Defaulter: api.Scheme,
Typer: api.Scheme,
UnsafeConvertor: api.Scheme,
Mapper: thirdpartyresourcedata.NewMapper(api.Registry.GroupOrDie(extensions.GroupName).RESTMapper, kind, version, group),
Linker: api.Registry.GroupOrDie(extensions.GroupName).SelfLinker,