Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude compact setup from a hci exception for get_node #11245

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions ocs_ci/ocs/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"] == 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a condition in the below for loop to skip master nodes. In compact mode cluster, the worker will also have the master node role. So no nodes will be selected.

):
typed_nodes = [
node
for node in typed_nodes
Expand Down
Loading