ericchiang / k8s

A simple Kubernetes Go client
Apache License 2.0
599 stars 108 forks source link

Failure 406 only the following media types are accepted: application/json, application/yaml #120

Closed threadproc closed 5 years ago

threadproc commented 5 years ago

When calling .Create with a CRD-defined object, the client attempts to send it as protobuf-encoded message which is rejected by the Kubernetes API.

ericchiang commented 5 years ago

Does your CRD implement the proto Message interface? If so this client will assume it should be encoded as a protobuf.

https://godoc.org/github.com/golang/protobuf/proto#Message

threadproc commented 5 years ago

Taking another look at it with fresh eyes, I'm extending the runtime.TypeMeta type, which brings in the Reset, String, and ProtoMessage functions.

Thanks!