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 changesclient- Kubernetes API clientzone_name- DNS zone name (e.g., “example.com”)namespace- Kubernetes namespace of the DNSZone resourcename- Name of the DNSZone resourceprimary_count- Number of primary instances successfully configuredsecondary_count- Number of secondary instances successfully configuredexpected_primary_count- Expected number of primary instancesexpected_secondary_count- Expected number of secondary instancesrecords_count- Number of DNS records discoveredgeneration- Metadata generation to set as observed
§Errors
Returns an error if status update fails to apply