mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #25707 from dims/fix-issue-14071
Automatic merge from submit-queue 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;
This commit is contained in:
commit
807241b84f
@ -8817,6 +8817,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"produces": [
|
"produces": [
|
||||||
|
"text/plain",
|
||||||
"application/json",
|
"application/json",
|
||||||
"application/yaml",
|
"application/yaml",
|
||||||
"application/vnd.kubernetes.protobuf"
|
"application/vnd.kubernetes.protobuf"
|
||||||
|
@ -8705,6 +8705,9 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
|
|||||||
<div class="ulist">
|
<div class="ulist">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
<p>text/plain</p>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
<p>application/json</p>
|
<p>application/json</p>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
@ -45,6 +45,16 @@ func (r *LogREST) New() runtime.Object {
|
|||||||
return &api.Pod{}
|
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
|
// 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) {
|
func (r *LogREST) Get(ctx api.Context, name string, opts runtime.Object) (runtime.Object, error) {
|
||||||
logOpts, ok := opts.(*api.PodLogOptions)
|
logOpts, ok := opts.(*api.PodLogOptions)
|
||||||
|
Loading…
Reference in New Issue
Block a user