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

refactor: update az iot ops check --pre to not warn for multi-node clusters #279

Merged
merged 3 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions azext_edge/edge/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ def load_iotops_help():
- {COMPAT_MQTT_BROKER_APIS.as_str()}
- {COMPAT_OPCUA_APIS.as_str()}

For more information on cluster requirements, please check https://aka.ms/iot-ops-cluster-requirements

examples:
- name: Basic usage. Checks `broker` health with summary output.
text: >
Expand Down
18 changes: 1 addition & 17 deletions azext_edge/edge/providers/check/base/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from typing import Any, Dict

from .check_manager import CheckManager
from .user_strings import MULTINODE_CLUSTER_MSG, NO_NODES_MSG, UNABLE_TO_FETCH_NODES_MSG
from .user_strings import NO_NODES_MSG, UNABLE_TO_FETCH_NODES_MSG
from ..common import (
AIO_SUPPORTED_ARCHITECTURES,
COLOR_STR_FORMAT,
Expand Down Expand Up @@ -58,22 +58,6 @@ def check_nodes(as_list: bool = False) -> Dict[str, Any]:
check_manager.add_display(target_name=target, display=target_display)
return check_manager.as_dict()

check_manager.add_target_eval(
target_name=target,
status=CheckTaskStatus.warning.value if len(nodes.items) > 1 else CheckTaskStatus.success.value,
value=len(nodes.items)
)
if len(nodes.items) > 1:
check_manager.add_display(
target_name=target,
display=Padding(
COLOR_STR_FORMAT.format(
color=CheckTaskStatus.warning.color,
value=MULTINODE_CLUSTER_MSG
),
padding
),
)
table = _generate_node_table(check_manager, nodes)
check_manager.add_display(target_name=target, display=Padding(table, padding))

Expand Down
1 change: 0 additions & 1 deletion azext_edge/edge/providers/check/base/user_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# ----------------------------------------------------------------------------------------------

CONNECTIVITY_ERROR = "{0} Is there connectivity to the cluster?"
MULTINODE_CLUSTER_MSG = "Currently, only single-node clusters are officially supported for AIO deployments"
NO_NODES_MSG = "No nodes detected."
UNABLE_TO_DETERMINE_VERSION_MSG = CONNECTIVITY_ERROR.format("Unable to determine kubernetes version.")
UNABLE_TO_FETCH_NODES_MSG = CONNECTIVITY_ERROR.format("Unable to fetch nodes.")
4 changes: 0 additions & 4 deletions azext_edge/tests/edge/checks/base/test_nodes_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,6 @@ def test_check_nodes(mocked_node_client):
assert result["status"] == "error"
assert evaluation[0]["value"] == "No nodes detected."
return
elif len(nodes) > 1:
warning = result["targets"]["cluster/nodes"]["_all_"]["displays"][0].renderable
assert "Currently, only single-node clusters are officially supported for AIO deployments" in warning
assert result["targets"]["cluster/nodes"]["_all_"]["status"] == "warning"
else:
assert result["targets"]["cluster/nodes"]["_all_"]["status"] == "success"

Expand Down