summaryrefslogtreecommitdiffstats
path: root/roles/lib_openshift
diff options
context:
space:
mode:
authorRussell Teague <rteague@redhat.com>2017-02-28 13:07:19 -0500
committerGitHub <noreply@github.com>2017-02-28 13:07:19 -0500
commit5df4b6f9987d44a87dd0e9844ec0810e8c8ac334 (patch)
tree6a82cbd5133d1c800d8ad7cf6431314b796b62cf /roles/lib_openshift
parentbfe7e99d9a09f06f021f73dfd2631e28dc3983b0 (diff)
parent0f48e1390277f569bd816e496681fcd7aaaa2665 (diff)
downloadopenshift-5df4b6f9987d44a87dd0e9844ec0810e8c8ac334.tar.gz
openshift-5df4b6f9987d44a87dd0e9844ec0810e8c8ac334.tar.bz2
openshift-5df4b6f9987d44a87dd0e9844ec0810e8c8ac334.tar.xz
openshift-5df4b6f9987d44a87dd0e9844ec0810e8c8ac334.zip
Merge pull request #3522 from mtnbikenc/pvc-type-fix
Add 'persistentVolumeClaim' to volume_info type
Diffstat (limited to 'roles/lib_openshift')
-rw-r--r--roles/lib_openshift/library/oc_adm_registry.py9
-rw-r--r--roles/lib_openshift/src/lib/volume.py9
2 files changed, 10 insertions, 8 deletions
diff --git a/roles/lib_openshift/library/oc_adm_registry.py b/roles/lib_openshift/library/oc_adm_registry.py
index e404f0e0e..7908dd91e 100644
--- a/roles/lib_openshift/library/oc_adm_registry.py
+++ b/roles/lib_openshift/library/oc_adm_registry.py
@@ -2063,20 +2063,21 @@ class Volume(object):
''' return a properly structured volume '''
volume_mount = None
volume = {'name': volume_info['name']}
- if volume_info['type'] == 'secret':
+ volume_type = volume_info['type'].lower()
+ if volume_type == 'secret':
volume['secret'] = {}
volume[volume_info['type']] = {'secretName': volume_info['secret_name']}
volume_mount = {'mountPath': volume_info['path'],
'name': volume_info['name']}
- elif volume_info['type'] == 'emptydir':
+ elif volume_type == 'emptydir':
volume['emptyDir'] = {}
volume_mount = {'mountPath': volume_info['path'],
'name': volume_info['name']}
- elif volume_info['type'] == 'pvc':
+ elif volume_type == 'pvc' or volume_type == 'persistentvolumeclaim':
volume['persistentVolumeClaim'] = {}
volume['persistentVolumeClaim']['claimName'] = volume_info['claimName']
volume['persistentVolumeClaim']['claimSize'] = volume_info['claimSize']
- elif volume_info['type'] == 'hostpath':
+ elif volume_type == 'hostpath':
volume['hostPath'] = {}
volume['hostPath']['path'] = volume_info['path']
diff --git a/roles/lib_openshift/src/lib/volume.py b/roles/lib_openshift/src/lib/volume.py
index 84ef1f705..e0abb1d1b 100644
--- a/roles/lib_openshift/src/lib/volume.py
+++ b/roles/lib_openshift/src/lib/volume.py
@@ -17,20 +17,21 @@ class Volume(object):
''' return a properly structured volume '''
volume_mount = None
volume = {'name': volume_info['name']}
- if volume_info['type'] == 'secret':
+ volume_type = volume_info['type'].lower()
+ if volume_type == 'secret':
volume['secret'] = {}
volume[volume_info['type']] = {'secretName': volume_info['secret_name']}
volume_mount = {'mountPath': volume_info['path'],
'name': volume_info['name']}
- elif volume_info['type'] == 'emptydir':
+ elif volume_type == 'emptydir':
volume['emptyDir'] = {}
volume_mount = {'mountPath': volume_info['path'],
'name': volume_info['name']}
- elif volume_info['type'] == 'pvc':
+ elif volume_type == 'pvc' or volume_type == 'persistentvolumeclaim':
volume['persistentVolumeClaim'] = {}
volume['persistentVolumeClaim']['claimName'] = volume_info['claimName']
volume['persistentVolumeClaim']['claimSize'] = volume_info['claimSize']
- elif volume_info['type'] == 'hostpath':
+ elif volume_type == 'hostpath':
volume['hostPath'] = {}
volume['hostPath']['path'] = volume_info['path']