finalize_zone_status

Function finalize_zone_status 

Source
pub async fn finalize_zone_status(
    status_updater: &mut DNSZoneStatusUpdater,
    client: &Client,
    zone_name: &str,
    namespace: &str,
    name: &str,
    primary_count: usize,
    secondary_count: usize,
    expected_primary_count: usize,
    expected_secondary_count: usize,
    records_count: usize,
    generation: Option<i64>,
) -> Result<()>
Expand description

Determine final zone status and apply conditions.

This function calculates the final Ready or Degraded status based on:

  • Whether any degraded conditions were set during reconciliation
  • Whether all expected instances were successfully configured
  • Number of records discovered

The function then applies all accumulated status changes to the API server in a single atomic operation.

§Arguments

  • status_updater - Status updater with accumulated changes
  • client - Kubernetes API client
  • zone_name - DNS zone name (e.g., “example.com”)
  • namespace - Kubernetes namespace of the DNSZone resource
  • name - Name of the DNSZone resource
  • primary_count - Number of primary instances successfully configured
  • secondary_count - Number of secondary instances successfully configured
  • 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

§Errors

Returns an error if status update fails to apply