set_final_zone_conditions

Function set_final_zone_conditions 

Source
pub fn set_final_zone_conditions(
    status_updater: &mut DNSZoneStatusUpdater,
    zone_name: &str,
    namespace: &str,
    name: &str,
    primary: ZoneConfigOutcome,
    secondary: ZoneConfigOutcome,
    expected_primary_count: usize,
    expected_secondary_count: usize,
    records_count: usize,
    generation: Option<i64>,
)
Expand description

Set the final zone conditions in memory (no API call).

This function calculates the final Ready/Degraded/Progressing status based on:

  • Whether any degraded conditions were set during reconciliation
  • Whether all expected INSTANCES were successfully configured (comparing instance counts with instance counts - never endpoint counts, which would mask partial pod failures)
  • Number of records discovered

The conditions always converge to a consistent triple:

  • Success: Ready=True, Degraded=False, Progressing=False
  • Failure/partial: Ready=False, Degraded=True, Progressing=False

§Arguments

  • status_updater - Status updater with accumulated changes
  • zone_name - DNS zone name (e.g., “example.com”)
  • namespace - Kubernetes namespace of the DNSZone resource
  • name - Name of the DNSZone resource
  • primary - Primary configuration outcome (instance + endpoint counts)
  • secondary - Secondary configuration outcome (instance + endpoint counts)
  • expected_primary_count - Expected number of primary instances
  • expected_secondary_count - Expected number of secondary instances
  • records_count - Number of DNS records discovered
  • generation - Metadata generation to set as observed