calculate_cluster_status

Function calculate_cluster_status 

Source
pub fn calculate_cluster_status(
    instances: &[Bind9Instance],
    namespace: &str,
    name: &str,
) -> (i32, i32, Vec<String>, Vec<Condition>)
Expand description

Calculate cluster status from instance health.

Analyzes the list of instances to determine cluster readiness. Creates both an encompassing Ready condition and individual conditions for each instance.

§Arguments

  • instances - List of Bind9Instance resources for the cluster
  • namespace - Cluster namespace (for logging)
  • name - Cluster name (for logging)

§Returns

Tuple of:

  • instance_count - Total number of instances
  • ready_instances - Number of ready instances
  • instance_names - Names of all instances
  • conditions - Vector of status conditions (Ready + per-instance)