cleanup_stale_records

Function cleanup_stale_records 

Source
pub async fn cleanup_stale_records(
    client: &Client,
    dnszone: &DNSZone,
    status_updater: &mut DNSZoneStatusUpdater,
    bind9_instances_store: &Store<Bind9Instance>,
) -> Result<usize>
Expand description

Clean up stale records from zone status.

Iterates through records in zone status and removes any that no longer exist in the Kubernetes API. Also performs self-healing by deleting orphaned records from BIND9 if they were missed by finalizers.

§Arguments

  • client - Kubernetes client
  • dnszone - The DNSZone resource being reconciled
  • status_updater - Status updater for modifying zone status
  • bind9_instances_store - Reflector store for querying Bind9Instance resources

§Returns

Number of records removed from status

§Errors

Returns an error if API calls fail critically (non-NotFound errors).