-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add status endpoint to base class #114
base: master
Are you sure you want to change the base?
Add status endpoint to base class #114
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
@@ -77,6 +77,31 @@ class JSONSchemaProps(Model): | |||
x_kubernetes_preserve_unknown_fields = Field(bool, name="x-kubernetes-preserve-unknown-fields") | |||
|
|||
|
|||
class JSONSchemaPropsStatusEnabled(Model): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.