Currently, on large deployments, OpenSearchHealth.apply will return HealthColors.IGNORE for the orchestrator clusters. However, there are certain situations, e.g. upgrades, where we need to know the status of the cluster before executing the node upgrade.
Therefore, we need an option to override the check:
def apply(
self,
wait_for_green_first: bool = False,
use_localhost: bool = True,
app: bool = True,
override: bool = False,
) -> str:
"""Fetch cluster health and set it on the app status."""
try:
host = self._charm.unit_ip if use_localhost else None
status = self._fetch_status(host, wait_for_green_first)
......
# compute health only in clusters where data nodes exist
if override:
return status
else:
compute_health = (
deployment_desc.start == StartMode.WITH_GENERATED_ROLES
or "data" in deployment_desc.config.roles
)
if not compute_health:
return HealthColors.IGNORE
Currently, on large deployments,
OpenSearchHealth.apply
will returnHealthColors.IGNORE
for the orchestrator clusters. However, there are certain situations, e.g. upgrades, where we need to know the status of the cluster before executing the node upgrade.Therefore, we need an option to override the check: