Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allows null conditions, fixes #415 #447

Closed
wants to merge 2 commits into from

Conversation

rmb938
Copy link

@rmb938 rmb938 commented Jan 29, 2018

No description provided.

@tomplus
Copy link
Member

tomplus commented Jan 30, 2018

Models are auto-generated by Swagger Codegen and shouldn't be changed in this way.

@rmb938
Copy link
Author

rmb938 commented Jan 30, 2018

Ah. So would removing conditions and acceptedNames from the required block in scripts/swagger.json be acceptable?

"v1beta1.CustomResourceDefinitionStatus": {
      "description": "CustomResourceDefinitionStatus indicates the state of the CustomResourceDefinition",
      "required": [
        "conditions",  <---- remove this?
        "acceptedNames"
      ],
      "properties": {
        "acceptedNames": {
          "description": "AcceptedNames are the names that are actually being used to serve discovery They may be different than the names in spec.",
          "$ref": "#/definitions/v1beta1.CustomResourceDefinitionNames"
        },
        "conditions": {
          "description": "Conditions indicate state for particular aspects of a CustomResourceDefinition",
          "type": "array",
          "items": {
            "$ref": "#/definitions/v1beta1.CustomResourceDefinitionCondition"
          }
        }
      }
    },

@mbohlool
Copy link
Contributor

@rmb938 that could be acceptable and you can do it in preporcessing script in /gen repo. However I would like to see a more generic solution to this, probably by changing OpenAPI spec in the main repo to reflect this for all type of null/empty lists not only CRDs.

@rmb938
Copy link
Author

rmb938 commented Jan 31, 2018

Alright, well do you have any pointers on that? I've never used Swagger for Codegen before so not really sure where to start. My use case is also just with CRDs and creating a more generic solution may become a much larger task,. I am fine with doing that but depending on the size it may make more sense for someone that knows the code base and the backing technologies to get it done much quicker.

@mbohlool
Copy link
Contributor

I would spend time on this if I had any :)

I created kubernetes-client/gen#52 and added what I think a good fix is there. it is very unorganized yet as it is only a brain dump. I will refine it on first free time I got.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants