Repository: kubernetes
Issue: Namespace deletion fails because object does not implement protobuf marshalling interface
Labels: kind/bug,priority/important-soon,sig/api-machinery,lifecycle/frozen

<!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks!

If the matter is security related, please disclose it privately via https://kubernetes.io/security/
-->


**What happened**:
Namespace stuck in deletion because API resource does not implement the protobuf marshalling interface.

**What you expected to happen**:
kube-controller-manager to be able to terminate the namespace.

**How to reproduce it (as minimally and precisely as possible)**:
1. Setup sample-apiserver@0.16.4 running on Kubernetes v1.16.4 (minikube provider) using the minikube walkthrough guide - https://github.com/kubernetes/sample-apiserver/blob/v0.16.4/docs/minikube-walkthrough.md.

2. Create namespace
```
$ k create ns foo
```

3. Delete the namespace and ensure the deletion fails
```
$ k delete ns foo

$ k get ns foo -o yaml
apiVersion: v1
kind: Namespace
metadata:
  creationTimestamp: "2019-12-15T19:41:31Z"
  deletionTimestamp: "2019-12-15T19:41:33Z"
  name: foo
  resourceVersion: "798"
  selfLink: /api/v1/namespaces/foo
  uid: e5b47622-6789-4f41-a2bd-eb04aadc6d90
spec:
  finalizers:
  - kubernetes
status:
  conditions:
  - lastTransitionTime: "2019-12-15T19:41:38Z"
    message: All resources successfully discovered
    reason: ResourcesDiscovered
    status: "False"
    type: NamespaceDeletionDiscoveryFailure
  - lastTransitionTime: "2019-12-15T19:41:38Z"
    message: All legacy kube types successfully parsed
    reason: ParsedGroupVersions
    status: "False"
    type: NamespaceDeletionGroupVersionParsingFailure
  - lastTransitionTime: "2019-12-15T19:41:38Z"
    message: 'Failed to delete all resource types, 1 remaining: object *v1alpha1.FlunderList
      does not implement the protobuf marshalling interface and cannot be encoded
      to a protobuf message'
    reason: ContentDeletionFailed
    status: "True"
    type: NamespaceDeletionContentFailure
  phase: Terminating
```

```
$ k logs wardle-server-lgkcm -n wardle wardle-server

E1227 11:06:58.528242       1 writers.go:105] apiserver was unable to write a JSON response: object *v1alpha1.FlunderList does not implement the protobuf marshalling interface and cannot be encoded to a protobuf message
E1227 11:06:58.909046       1 writers.go:105] apiserver was unable to write a JSON response: object *v1alpha1.FlunderList does not implement the protobuf marshalling interface and cannot be encoded to a protobuf message
E1227 11:06:59.321062       1 writers.go:105] apiserver was unable to write a JSON response: object *v1alpha1.FlunderList does not implement the protobuf marshalling interface and cannot be encoded to a protobuf message
E1227 11:07:00.314837       1 writers.go:105] apiserver was unable to write a JSON response: object *v1alpha1.FlunderList does not implement the protobuf marshalling interface and cannot be encoded to a protobuf message
E1227 11:07:01.743636       1 writers.go:105] apiserver was unable to write a JSON response: object *v1alpha1.FlunderList does not implement the protobuf marshalling interface and cannot be encoded to a protobuf message
E1227 11:07:04.592075       1 writers.go:105] apiserver was unable to write a JSON response: object *v1alpha1.FlunderList does not implement the protobuf marshalling interface and cannot be encoded to a protobuf message
E1227 11:07:09.755761       1 writers.go:105] apiserver was unable to write a JSON response: object *v1alpha1.FlunderList does not implement the protobuf marshalling interface and cannot be encoded to a protobuf message
E1227 11:07:20.189966       1 writers.go:105] apiserver was unable to write a JSON response: object *v1alpha1.FlunderList does not implement the protobuf marshalling interface and cannot be encoded to a protobuf message
E1227 11:07:40.774322       1 writers.go:105] apiserver was unable to write a JSON response: object *v1alpha1.FlunderList does not implement the protobuf marshalling interface and cannot be encoded to a protobuf message
E1227 11:08:21.927852       1 writers.go:105] apiserver was unable to write a JSON response: object *v1alpha1.FlunderList does not implement the protobuf marshalling interface and cannot be encoded to a protobuf message
E1227 11:09:43.951662       1 writers.go:105] apiserver was unable to write a JSON response: object *v1alpha1.FlunderList does not implement the protobuf marshalling interface and cannot be encoded to a protobuf message
E1227 11:11:57.372764       1 writers.go:105] apiserver was unable to write a JSON response: object *v1alpha1.FlunderList does not implement the protobuf marshalling interface and cannot be encoded to a protobuf message
```

```
$ k logs -n kube-system kube-controller-manager-minikube

E1227 11:07:01.906469       1 namespace_controller.go:148] deletion of namespace foo failed: object *v1alpha1.FlunderList does not implement the protobuf marshalling interface and cannot be encoded to a protobuf message
E1227 11:07:04.611506       1 namespace_controller.go:148] deletion of namespace foo failed: object *v1alpha1.FlunderList does not implement the protobuf marshalling interface and cannot be encoded to a protobuf message
E1227 11:07:09.862402       1 namespace_controller.go:148] deletion of namespace foo failed: object *v1alpha1.FlunderList does not implement the protobuf marshalling interface and cannot be encoded to a protobuf message
E1227 11:07:20.210405       1 namespace_controller.go:148] deletion of namespace foo failed: object *v1alpha1.FlunderList does not implement the protobuf marshalling interface and cannot be encoded to a protobuf message
E1227 11:07:40.807497       1 namespace_controller.go:148] deletion of namespace foo failed: object *v1alpha1.FlunderList does not implement the protobuf marshalling interface and cannot be encoded to a protobuf message
E1227 11:08:21.965230       1 namespace_controller.go:148] deletion of namespace foo failed: object *v1alpha1.FlunderList does not implement the protobuf marshalling interface and cannot be encoded to a protobuf message
E1227 11:09:44.008476       1 namespace_controller.go:148] deletion of namespace foo failed: object *v1alpha1.FlunderList does not implement the protobuf marshalling interface and cannot be encoded to a protobuf message
E1227 11:11:57.431584       1 namespace_controller.go:148] deletion of namespace foo failed: object *v1alpha1.FlunderList does not implement the protobuf marshalling interface and cannot be encoded to a protobuf message
E1227 11:16:57.455757       1 namespace_controller.go:148] deletion of namespace foo failed: object *v1alpha1.FlunderList does not implement the protobuf marshalling interface and cannot be encoded to a protobuf message
```

**Anything else we need to know?**:
k8s.io/sample-apiserver types do not implement the protobuf marshalling interface but the kube-controller-manager does not fallback to json.
Is it a hard requirement for Kubernetes v1.16 the api resources to implement the protobuf marshaling interface or I miss some configuration of kube-contoroller-manager?

**Environment**:
- Kubernetes version (use `kubectl version`):
```
$ k version --short
Client Version: v1.16.1
Server Version: v1.16.3
```

- Cloud provider or hardware configuration:
- OS (e.g: `cat /etc/os-release`):
- Kernel (e.g. `uname -a`):
- Install tools: minikube
- Network plugin and version (if this is a network-related bug):
- Others: