From 0101c000a6e1e944f98a037183d9f222ee9aeb13 Mon Sep 17 00:00:00 2001 From: "Jose A. Rivera" Date: Mon, 12 Feb 2018 08:56:35 -0600 Subject: Allow for blank StorageClass in PVC creation In the case where a default StorageClass is already defined and a PV's storage kind is not 'dynamic', allows for the storageClassName of the associated PVC to be blank so as to not use the default SC. Signed-off-by: Jose A. Rivera --- .../templates/persistent-volume-claim.yml.j2 | 3 +++ 1 file changed, 3 insertions(+) (limited to 'roles/openshift_persistent_volumes/templates/persistent-volume-claim.yml.j2') diff --git a/roles/openshift_persistent_volumes/templates/persistent-volume-claim.yml.j2 b/roles/openshift_persistent_volumes/templates/persistent-volume-claim.yml.j2 index fac589a92..ca8b747ee 100644 --- a/roles/openshift_persistent_volumes/templates/persistent-volume-claim.yml.j2 +++ b/roles/openshift_persistent_volumes/templates/persistent-volume-claim.yml.j2 @@ -12,4 +12,7 @@ items: resources: requests: storage: "{{ claim.capacity }}" +{% if claim.storageclass is not None %} + storageClassName: "{{ claim.storageclass }}" +{% endif %} {% endfor %} -- cgit v1.2.1