-
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 v1 model and tests for poddisruptionbudgets #108
base: master
Are you sure you want to change the base?
Conversation
bfe1e14
to
87054c6
Compare
87054c6
to
c55591b
Compare
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.
I've left some suggestions in line, please take a look
values = ListField(six.text_type) | ||
|
||
|
||
class LabelSelector(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.
I see that there are three other LabelSelector
model classes which seem to represent the same API resource already:
- https://github.com/fiaas/k8s/blob/master/k8s/models/deployment.py#L28
- https://github.com/fiaas/k8s/blob/master/k8s/models/job.py#L26
- https://github.com/fiaas/k8s/blob/master/k8s/models/pod_disruption_budget.py#L33
Perhaps one step towards improving this situation could be to move this LabelSelector class into a new meta_v1
module (to follow the naming convention) and use that here. At some point it would be good to switch to the same class in every model that uses LabelSelector, but since that is a breaking change I don't think it is necessary to do in this changeset. What do you think?
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.
i think it's a good idea, though we already have a common package which currently houses metav1 type objects. So i think it would go best in there. If we really want to call it meta_v1 we should move everything over there
The code analysis issues can be fixed by disabling the check for the test class; see for example https://github.com/fiaas/k8s/blob/master/tests/k8s/test_apiextensions_v1_custom_resource_definition.py#L31 |
This PR adds poddisruptionbudgets from the policy/v1 apiversion. PDB's were partially implemented with the v1beta1 version in 2018, but these were never put into use.