-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from fgogolli/master
Add support for PodDisruptionBudget
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |