From 028e92b1b2dcbaffd4a80061cc3d387877b59d62 Mon Sep 17 00:00:00 2001 From: John O Loughlin Date: Tue, 15 May 2018 16:20:33 +0100 Subject: Add "restartPolicy" parameter in Kubernetes policy This new parameter, "restartPolicy", will allow define the restart policy per pod. Example of yaml definition in Kubernetes: apiVersion: v1 kind: Pod metadata: name: frontend spec: containers: - name: db ... restartPolicy: Always # Possible values: "Always", "OnFailure" and "Never" Example of definition in a Yardstick context: context: type: Kubernetes servers: host: containers: - name: ... restartPolicy: Always # Default value: "Always" Restart policy [1]. [1] https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy JIRA: YARDSTICK-1175 Change-Id: Id4317b909f98422e89d6d4553e8cfb0e1f593355 Signed-off-by: John O Loughlin --- yardstick/common/exceptions.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'yardstick/common') diff --git a/yardstick/common/exceptions.py b/yardstick/common/exceptions.py index 50def0647..018654a4e 100644 --- a/yardstick/common/exceptions.py +++ b/yardstick/common/exceptions.py @@ -237,6 +237,10 @@ class KubernetesNetworkObjectKindMissing(YardstickException): message = 'Kubernetes kind "Network" is not defined' +class KubernetesWrongRestartPolicy(YardstickException): + message = 'Restart policy "%(rpolicy)s" is not valid' + + class ScenarioCreateNetworkError(YardstickException): message = 'Create Neutron Network Scenario failed' -- cgit 1.2.3-korg