Bladeren bron

Do not create volume claims for hosted components when storage type is object.

Andrew Butcher 8 jaren geleden
bovenliggende
commit
49d3ab1672
1 gewijzigde bestanden met toevoegingen van 8 en 7 verwijderingen
  1. 8 7
      filter_plugins/oo_filters.py

+ 8 - 7
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,