From 2d59390d6e5696c7a898f3f391c5afbee36485a9 Mon Sep 17 00:00:00 2001 From: fbalak Date: Tue, 28 Jan 2025 14:15:51 +0100 Subject: [PATCH 1/3] exclude compact setup from a hci exception for get_node Signed-off-by: fbalak --- ocs_ci/ocs/node.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ocs_ci/ocs/node.py b/ocs_ci/ocs/node.py index bc24e26d200..546625e0e80 100644 --- a/ocs_ci/ocs/node.py +++ b/ocs_ci/ocs/node.py @@ -79,7 +79,8 @@ def get_nodes(node_type=constants.WORKER_MACHINE, num_of_nodes=None): """ Get cluster's nodes according to the node type (e.g. worker, master) and the number of requested nodes from that type. - In case of HCI provider cluster and 'node_type' is worker, it will exclude the master nodes. + In case of HCI provider cluster and 'node_type' is worker and it is + not a compact setup, it will exclude the master nodes. Args: node_type (str): The node type (e.g. worker, master) @@ -110,7 +111,11 @@ def get_nodes(node_type=constants.WORKER_MACHINE, num_of_nodes=None): if node_type in node.ocp.get_resource(resource_name=node.name, column="ROLES") ] - if is_hci_provider_cluster() and node_type == constants.WORKER_MACHINE: + if ( + is_hci_provider_cluster() + and node_type == constants.WORKER_MACHINE + and config.ENV_DATA["worker_replicas"] is not 0 + ): typed_nodes = [ node for node in typed_nodes From 6079a56a86374a9a9000613d0999048018438962 Mon Sep 17 00:00:00 2001 From: fbalak Date: Tue, 28 Jan 2025 14:20:49 +0100 Subject: [PATCH 2/3] fix comparison Signed-off-by: fbalak --- ocs_ci/ocs/node.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocs_ci/ocs/node.py b/ocs_ci/ocs/node.py index 546625e0e80..53688adc44f 100644 --- a/ocs_ci/ocs/node.py +++ b/ocs_ci/ocs/node.py @@ -114,7 +114,7 @@ def get_nodes(node_type=constants.WORKER_MACHINE, num_of_nodes=None): if ( is_hci_provider_cluster() and node_type == constants.WORKER_MACHINE - and config.ENV_DATA["worker_replicas"] is not 0 + and config.ENV_DATA["worker_replicas"] == 0 ): typed_nodes = [ node From f9af5cdc9f7101c9acc49a1105221b3bade95793 Mon Sep 17 00:00:00 2001 From: fbalak Date: Wed, 29 Jan 2025 11:23:17 +0100 Subject: [PATCH 3/3] fix condition Signed-off-by: fbalak --- ocs_ci/ocs/node.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocs_ci/ocs/node.py b/ocs_ci/ocs/node.py index 53688adc44f..7c612c9a34b 100644 --- a/ocs_ci/ocs/node.py +++ b/ocs_ci/ocs/node.py @@ -114,7 +114,7 @@ def get_nodes(node_type=constants.WORKER_MACHINE, num_of_nodes=None): if ( is_hci_provider_cluster() and node_type == constants.WORKER_MACHINE - and config.ENV_DATA["worker_replicas"] == 0 + and config.ENV_DATA["worker_replicas"] != 0 ): typed_nodes = [ node