summaryrefslogtreecommitdiffstats
path: root/openshift-storage-libs/openshiftstoragelibs/openshift_ops.py
diff options
context:
space:
mode:
authorValerii Ponomarov <vponomar@redhat.com>2019-10-25 21:04:33 +0530
committerValerii Ponomarov <vponomar@redhat.com>2019-10-31 19:55:46 +0530
commitc2813c9d15d0ca5379a69c468c4586a623e5613a (patch)
tree60087547b3fb3b58bf3cdfccb9146bdb07d3f98a /openshift-storage-libs/openshiftstoragelibs/openshift_ops.py
parent8ff1ad960ac164e1157df69f12c748e764d8af4f (diff)
Make 'provisioner' be autocalculated for storage classes
In OCS 3.11.4 was changed the approach for 'provisioners' in storage classes due to the BugZilla bugs [1] and [2]. So, change the approach for getting 'provisioner' value in this project making it be autocalculated based on the data taken from the block provisioner pod, which is located in the working namespace. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1732787 [2] https://bugzilla.redhat.com/show_bug.cgi?id=1738394 Change-Id: Ic1037038e39abba2b2a1ad6dc3ddbfe42473cb88 Signed-off-by: vamahaja <vamahaja@redhat.com>
Diffstat (limited to 'openshift-storage-libs/openshiftstoragelibs/openshift_ops.py')
-rw-r--r--openshift-storage-libs/openshiftstoragelibs/openshift_ops.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/openshift-storage-libs/openshiftstoragelibs/openshift_ops.py b/openshift-storage-libs/openshiftstoragelibs/openshift_ops.py
index 9acec4e..c8b4201 100644
--- a/openshift-storage-libs/openshiftstoragelibs/openshift_ops.py
+++ b/openshift-storage-libs/openshiftstoragelibs/openshift_ops.py
@@ -511,6 +511,13 @@ def oc_get_custom_resource(ocp_node, rtype, custom, name=None, selector=None):
return out_list
+def get_block_provisioner(ocp_node):
+ return oc_get_custom_resource(
+ ocp_node, 'dc', selector="glusterblock",
+ custom=(r'":.spec.template.spec.containers[*].'
+ r'env[?(@.name==\"PROVISIONER_NAME\")].value"'))[0][0]
+
+
def oc_get_yaml(ocp_node, rtype, name=None, raise_on_error=True):
"""Get an OCP resource by name.