summaryrefslogtreecommitdiffstats
path: root/filter_plugins
diff options
context:
space:
mode:
authorAndrew Butcher <abutcher@redhat.com>2016-09-19 14:27:55 -0400
committerAndrew Butcher <abutcher@redhat.com>2016-09-19 14:27:55 -0400
commit49d3ab1672111365a94c1ae6d133fb70cf29f103 (patch)
tree58bfc81207ad6af3e2b8735c0f3363e883dbaf12 /filter_plugins
parente092de714dc09a86a0ff26c648eec2033a3b9952 (diff)
downloadopenshift-49d3ab1672111365a94c1ae6d133fb70cf29f103.tar.gz
openshift-49d3ab1672111365a94c1ae6d133fb70cf29f103.tar.bz2
openshift-49d3ab1672111365a94c1ae6d133fb70cf29f103.tar.xz
openshift-49d3ab1672111365a94c1ae6d133fb70cf29f103.zip
Do not create volume claims for hosted components when storage type is object.
Diffstat (limited to 'filter_plugins')
-rw-r--r--filter_plugins/oo_filters.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/filter_plugins/oo_filters.py b/filter_plugins/oo_filters.py
index eeb04cb4e..ba9c3f931 100644
--- a/filter_plugins/oo_filters.py
+++ b/filter_plugins/oo_filters.py
@@ -735,13 +735,14 @@ class FilterModule(object):
if 'hosted' in hostvars['openshift']:
for component in hostvars['openshift']['hosted']:
if 'storage' in hostvars['openshift']['hosted'][component]:
- kind = hostvars['openshift']['hosted'][component]['storage']['kind']
- create_pv = hostvars['openshift']['hosted'][component]['storage']['create_pv']
- create_pvc = hostvars['openshift']['hosted'][component]['storage']['create_pvc']
- if kind != None and create_pv and create_pvc:
- volume = hostvars['openshift']['hosted'][component]['storage']['volume']['name']
- size = hostvars['openshift']['hosted'][component]['storage']['volume']['size']
- access_modes = hostvars['openshift']['hosted'][component]['storage']['access_modes']
+ params = hostvars['openshift']['hosted'][component]['storage']
+ kind = params['kind']
+ create_pv = params['create_pv']
+ create_pvc = params['create_pvc']
+ if kind not in [None, 'object'] and create_pv and create_pvc:
+ volume = params['volume']['name']
+ size = params['volume']['size']
+ access_modes = params['access_modes']
persistent_volume_claim = dict(
name="{0}-claim".format(volume),
capacity=size,