Add status endpoint to base class#114
Conversation
oyvindio
left a comment
There was a problem hiding this comment.
Thanks for the PR!
I think this looks reasonable. I've left some minor comments in line. In addition, it would be ideal to add some tests which verify the basic behavior of the save_status method added here. There are some tests for some of the other model methods here which might be useful as a starting point
Apologies for the delayed review
| openAPIV3Schema = Field(JSONSchemaProps) | ||
|
|
||
|
|
||
| class CustomResourceValidationStatusEnabled(Model): | ||
| openAPIV3Schema = Field(JSONSchemaPropsStatusEnabled) |
There was a problem hiding this comment.
Since the difference in allowed fields when the status subresource is enabled is only in JSONSchemaProps, maybe CustomResourceValidationStatusEnabled can be made unnecessary by letting CustomResourceValidation.openAPIV3Schema be either JSONSchemaProps type
| openAPIV3Schema = Field(JSONSchemaProps) | |
| class CustomResourceValidationStatusEnabled(Model): | |
| openAPIV3Schema = Field(JSONSchemaPropsStatusEnabled) | |
| openAPIV3Schema = Field(JSONSchemaProps, alt_type=JSONSchemaPropsStatusEnabled) |
| x_kubernetes_preserve_unknown_fields = Field(bool, name="x-kubernetes-preserve-unknown-fields") | ||
|
|
||
|
|
||
| class JSONSchemaPropsStatusEnabled(Model): |
There was a problem hiding this comment.
Fields with type six.text_type should be changed to str, after dropping Python 2.x support and removing dependency on six in #116
This will introduce the possibility to modify the status endpoint on the models.