kubernetes-client / gen

Common generator scripts for all client libraries

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

missing support for custom object status/scale api

juliantaylor opened this issue · comments

since kubernetes 1.11 the custom object status/scale api is in beta:
https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#status-subresource

But the generator does not support it as it is missing in openapi/custom_objects_spec.json
If this is not intentional due to the beta status of the api it would be very helpful to have this added so clients can generate code for it.

This isnt intentional. We should fix, would love a pr...

I'd love to but I can't find any documentation how this file is generated.

@mbohlool as you added the file originally, can you provide some guidance on how to best update it?

You just need to edit that JSON Swagger file to have the new object, then everything "just works" when you regenerate...

See the code here:

CUSTOM_OBJECTS_SPEC_PATH = os.path.join(

def add_custom_objects_spec(spec):

yeah sure, but do you manually write that swagger file? It looks generated.

This is the file: https://github.com/kubernetes-client/gen/blob/master/openapi/custom_objects_spec.json

It is not auto-generated. The code Brendan referenced is where this spec get merged with the main spec (that one is generated). You can edit that file and add /scale and /status endpoints.

yes thanks, I have already created a PR with the additions