Fix Incorrect response model for pods/{name}/log

The swagger spec for pods/{name}/log does not include
"text/plain" as a possible content-type for the the response.
So we implement ProducesMIMETypes to make sure "text/plain"
gets added to the default list ot content-types.

the v1.json was generated by running:
hack/update-generated-swagger-docs.sh;./hack/update-swagger-spec.sh;

Fixes #14071
This commit is contained in:
Davanum Srinivas 2016-05-16 21:20:46 -04:00
parent 7f528c67ca
commit e7a46a7c81
3 changed files with 14 additions and 0 deletions

View File

@ -8817,6 +8817,7 @@
}
],
"produces": [
"text/plain",
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"

View File

@ -8705,6 +8705,9 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
<div class="ulist">
<ul>
<li>
<p>text/plain</p>
</li>
<li>
<p>application/json</p>
</li>
<li>

View File

@ -45,6 +45,16 @@ func (r *LogREST) New() runtime.Object {
return &api.Pod{}
}
// LogREST implements StorageMetadata
func (r *LogREST) ProducesMIMETypes(verb string) []string {
// Since the default list does not include "plain/text", we need to
// explicitly override ProducesMIMETypes, so that it gets added to
// the "produces" section for pods/{name}/log
return []string{
"text/plain",
}
}
// Get retrieves a runtime.Object that will stream the contents of the pod log
func (r *LogREST) Get(ctx api.Context, name string, opts runtime.Object) (runtime.Object, error) {
logOpts, ok := opts.(*api.PodLogOptions)