*/* content encoding...

14 views
Skip to first unread message

Brendan Burns

unread,
May 30, 2017, 3:35:45 PM5/30/17
to Mehdy Bohlool, K8s API Machinery SIG
Hey Folks,
I was playing around with the Swagger-Codegen Java Client and it barfs on the */* content encoding:

io.kubernetes.client.ApiException: Content type "*/*" is not supported
        at io.kubernetes.client.ApiClient.serialize(ApiClient.java:884)
        at io.kubernetes.client.ApiClient.buildCall(ApiClient.java:1100)
        at io.kubernetes.client.apis.CoreV1Api.createNodeCall(CoreV1Api.java:7985)
        at io.kubernetes.client.apis.CoreV1Api.createNodeValidateBeforeCall(CoreV1Api.java:7997)
        at io.kubernetes.client.apis.CoreV1Api.createNodeWithHttpInfo(CoreV1Api.java:8028)
        at io.kubernetes.client.apis.CoreV1Api.createNode(CoreV1Api.java:8015)
        at io.kubernetes.client.examples.CSeriesDemo.main(CSeriesDemo.java:30)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
        at java.lang.Thread.run(Thread.java:748)

Why do we use that encoding? Should we fix this upstream in swagger-codegen or in our swagger spec?

--brendan

Clayton Coleman

unread,
May 30, 2017, 3:44:55 PM5/30/17
to Brendan Burns, Mehdy Bohlool, K8s API Machinery SIG
The current reason it's added is because of go-restful (which otherwise fails if an endpoint answers with different encoding).  That's leaked out into the docs, but there's no reason we couldn't prune it.
--
You received this message because you are subscribed to the Google Groups "K8s API Machinery SIG" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-sig-api-m...@googlegroups.com.
To post to this group, send email to kubernetes-sig...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kubernetes-sig-api-machinery/CAOgwWTuU_0WLz4K8GFOw7Kx7nTeYobFMRmkbJ8wm9%3DR%2BJvzR2g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Brendan Burns

unread,
May 30, 2017, 3:56:39 PM5/30/17
to Clayton Coleman, Mehdy Bohlool, K8s API Machinery SIG
But why is it only on some APIs?

Clayton Coleman

unread,
May 30, 2017, 3:58:03 PM5/30/17
to Brendan Burns, Mehdy Bohlool, K8s API Machinery SIG
Oh, also proxy.  Which has to support all content types.

Do the watch ones not have it?

Brendan Burns

unread,
May 30, 2017, 4:43:16 PM5/30/17
to Clayton Coleman, Mehdy Bohlool, K8s API Machinery SIG

Maybe it's all POST operations? I haven't run into it previously, but I was only doing GET requests...

Brendan Burns

unread,
May 30, 2017, 7:28:29 PM5/30/17
to Clayton Coleman, Mehdy Bohlool, K8s API Machinery SIG
fwiw, it looks like application/json-patch+json isn't supported either. That seems like something that needs to be fixed upstream?

io.kubernetes.client.ApiException: Content type "application/json-patch+json" is not supported
        at io.kubernetes.client.ApiClient.serialize(ApiClient.java:887)
        at io.kubernetes.client.ApiClient.buildCall(ApiClient.java:1103)
        at io.kubernetes.client.apis.CoreV1Api.patchNodeStatusCall(CoreV1Api.java:19653)
        at io.kubernetes.client.apis.CoreV1Api.patchNodeStatusValidateBeforeCall(CoreV1Api.java:19670)
        at io.kubernetes.client.apis.CoreV1Api.patchNodeStatusWithHttpInfo(CoreV1Api.java:19703)
        at io.kubernetes.client.apis.CoreV1Api.patchNodeStatus(CoreV1Api.java:19689)
        at io.kubernetes.client.examples.CSeriesDemo.main(CSeriesDemo.java:52)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
        at java.lang.Thread.run(Thread.java:748)

Clayton Coleman

unread,
May 30, 2017, 8:41:19 PM5/30/17
to Brendan Burns, Mehdy Bohlool, K8s API Machinery SIG
Not sure - we tell gorestful what we accept.  Should just be able to add it to apiserver/.../handlers/installer.go

A few of the endpoints contribute their own mime types (specially logs and portforward, and proxy)

Brendan Burns

unread,
May 30, 2017, 9:41:10 PM5/30/17
to Clayton Coleman, Mehdy Bohlool, K8s API Machinery SIG

This isn't about accepting as it turns out, it's what the client believes it can serialize before it even sends it to the server...

Reply all
Reply to author
Forward
0 new messages