summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--k8s/k8sclient/k8sclient.py4
-rw-r--r--k8s/tests/test_k8sclient_deploy.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/k8s/k8sclient/k8sclient.py b/k8s/k8sclient/k8sclient.py
index 3122e63..c1f378f 100644
--- a/k8s/k8sclient/k8sclient.py
+++ b/k8s/k8sclient/k8sclient.py
@@ -298,10 +298,10 @@ def _parse_volumes(volume_list):
vname = str(uuid.uuid4())
vcontainer = v['container']['bind']
vro = (v['container'].get('mode') == 'ro')
- if 'host' in v:
+ if ('host' in v) and ('path' in v['host']):
vhost = v['host']['path']
volumes.append(client.V1Volume(name=vname, host_path=client.V1HostPathVolumeSource(path=vhost)))
- if 'config_volume' in v:
+ if ('config_volume' in v) and ('name' in v['config_volume']):
vconfig_volume = v['config_volume']['name']
volumes.append(client.V1Volume(name=vname, config_map=client.V1ConfigMapVolumeSource(default_mode="0644",
name=vconfig_volume,
diff --git a/k8s/tests/test_k8sclient_deploy.py b/k8s/tests/test_k8sclient_deploy.py
index 486029e..55daf3b 100644
--- a/k8s/tests/test_k8sclient_deploy.py
+++ b/k8s/tests/test_k8sclient_deploy.py
@@ -2,7 +2,7 @@
# org.onap.dcae
# ================================================================================
# Copyright (c) 2018-2020 AT&T Intellectual Property. All rights reserved.
-# Copyright (c) 2020 Nokia. All rights reserved.
+# Copyright (c) 2020-2021 Nokia. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.