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

add v1 model and tests for poddisruptionbudgets #108

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

j18e
Copy link
Contributor

@j18e j18e commented May 2, 2022

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.

@j18e j18e requested a review from a team as a code owner May 2, 2022 12:25
@j18e j18e force-pushed the add-pod-disruption-budget branch from bfe1e14 to 87054c6 Compare May 2, 2022 12:36
@j18e j18e force-pushed the add-pod-disruption-budget branch from 87054c6 to c55591b Compare May 2, 2022 12:40
Copy link
Member

@oyvindio oyvindio left a 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

k8s/models/policy_v1_pod_disruption_budget.py Show resolved Hide resolved
values = ListField(six.text_type)


class LabelSelector(Model):
Copy link
Member

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:

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?

Copy link
Contributor Author

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

@oyvindio
Copy link
Member

oyvindio commented Jun 2, 2022

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

@j18e j18e requested a review from oyvindio June 2, 2022 08:13
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.

2 participants