From c2813c9d15d0ca5379a69c468c4586a623e5613a Mon Sep 17 00:00:00 2001 From: Valerii Ponomarov Date: Fri, 25 Oct 2019 21:04:33 +0530 Subject: 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 --- openshift-storage-libs/openshiftstoragelibs/openshift_ops.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'openshift-storage-libs/openshiftstoragelibs/openshift_ops.py') diff --git a/openshift-storage-libs/openshiftstoragelibs/openshift_ops.py b/openshift-storage-libs/openshiftstoragelibs/openshift_ops.py index 9acec4ef..c8b4201d 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. -- cgit