Skip to content

Commit

Permalink
Merge pull request #26 from fiaas/lifecycle-hooks
Browse files Browse the repository at this point in the history
Support for lifecycle hooks
  • Loading branch information
mortenlj authored Jan 4, 2018
2 parents ff629c8 + f6da11e commit 6f8c0de
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions k8s/models/pod.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,17 @@ class Probe(Model):
periodSeconds = Field(int)


class Handler(Model):
httpGet = Field(HTTPGetAction)
tcpSocket = Field(TCPSocketAction)
_exec = Field(ExecAction)


class Lifecycle(Model):
postStart = Field(Handler)
preStop = Field(Handler)


class Container(Model):
name = Field(six.text_type)
image = Field(six.text_type)
Expand All @@ -115,6 +126,7 @@ class Container(Model):
envFrom = ListField(EnvFromSource)
resources = Field(ResourceRequirements)
volumeMounts = ListField(VolumeMount)
lifecycle = Field(Lifecycle)
livenessProbe = Field(Probe)
readinessProbe = Field(Probe)
imagePullPolicy = Field(six.text_type, "IfNotPresent")
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py27,py33,py34,py35,py36
envlist = py27,py34,py35,py36
skip_missing_interpreters=True

[testenv]
Expand Down

0 comments on commit 6f8c0de

Please sign in to comment.