aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/common/exceptions.py
diff options
context:
space:
mode:
authorRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-05-08 17:42:08 +0100
committerRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-06-14 07:15:35 +0000
commitfa269e3789d19f1335ae9207817203c6ad58cf42 (patch)
treed08c2f7fdd09d2e1a7a8913732ed8c1f435937ea /yardstick/common/exceptions.py
parent3b43905b749b65bd229db8f3f1ce10c29f9b9e37 (diff)
Add new Kubernetes resource kind: "CustomResourceDefinition"
Custom resource definition example in Kubernetes: apiVersion: "apiextensions.k8s.io/v1beta" kind: CustomResourceDefinition metadata: name: networks.kubernetes.com spec: group: kubernetes.com version: v1 scope: Namespaced names: plural: networks singular: network kind: Network Proposed Kubernetes context network definition: context: custom_resources:     - name: network        # name of the resource (singular)       version: v1          # optional, "v1" by default       scope: Namespaced    # optional, "Namespaced" by default From this definition, we will extract the Kubernetes parameters: - metadata.name: custom_resources.name + "s" + context_name + ".com" - spec.group: context_name + ".com" - spec.scope: custom_resources.scope - spec.version: custom_resources.version - spec.names.plural: custom_resources.name + "s" - spec.names.singular: custom_resources.name - spec.names.kind: custom_resources.name with first capital letter [1] https://kubernetes.io/docs/concepts/api-extension/custom-resources/ JIRA: YARDSTICK-1163 Change-Id: If8980dc3f6ddf9c6949bf15be8011aa98482ddc9 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
Diffstat (limited to 'yardstick/common/exceptions.py')
-rw-r--r--yardstick/common/exceptions.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/yardstick/common/exceptions.py b/yardstick/common/exceptions.py
index 5f362b356..e370b92bf 100644
--- a/yardstick/common/exceptions.py
+++ b/yardstick/common/exceptions.py
@@ -14,6 +14,8 @@
from oslo_utils import excutils
+from yardstick.common import constants
+
class ProcessExecutionError(RuntimeError):
def __init__(self, message, returncode):
@@ -195,10 +197,24 @@ class WaitTimeout(YardstickException):
message = 'Wait timeout while waiting for condition'
+class KubernetesApiException(YardstickException):
+ message = ('Kubernetes API errors. Action: %(action)s, '
+ 'resource: %(resource)s')
+
+
+class KubernetesConfigFileNotFound(YardstickException):
+ message = 'Config file (%s) not found' % constants.K8S_CONF_FILE
+
+
class KubernetesTemplateInvalidVolumeType(YardstickException):
message = 'No valid "volume" types present in %(volume)s'
+class KubernetesCRDObjectDefinitionError(YardstickException):
+ message = ('Kubernetes Custom Resource Definition Object error, missing '
+ 'parameters: %(missing_parameters)s')
+
+
class ScenarioCreateNetworkError(YardstickException):
message = 'Create Neutron Network Scenario failed'