Skip to content

Commit

Permalink
Merge pull request #32 from fgogolli/master
Browse files Browse the repository at this point in the history
Add support for PodDisruptionBudget
  • Loading branch information
oyvindio authored Feb 8, 2018
2 parents 1724ef4 + 05b3476 commit 95d6af8
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions k8s/models/pod_disruption_budget.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env python
# -*- coding: utf-8
from __future__ import absolute_import

import six

from .common import ObjectMeta
from ..base import Model
from ..fields import Field, ListField


class LabelSelectorRequirement(Model):
key = Field(six.text_type)
operator = Field(six.text_type)
values = ListField(six.text_type)


class LabelSelector(Model):
matchExpressions = Field(LabelSelectorRequirement)
matchLabels = Field(dict)


class PodDisruptionBudgetSpec(Model):
minAvailable = Field(six.text_type)
maxUnavailable = Field(six.text_type)
selector = Field(LabelSelector)


class PodDisruptionBudget(Model):
class Meta:
url_template = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}"

metadata = Field(ObjectMeta)
spec = Field(PodDisruptionBudgetSpec)

0 comments on commit 95d6af8

Please sign in to comment.