delete_record

Function delete_record 

Source
pub async fn delete_record<T>(
    client: &Client,
    record: &T,
    record_type: &str,
    record_type_hickory: RecordType,
    stores: &Stores,
) -> Result<()>
where T: Resource<DynamicType = (), Scope = NamespaceResourceScope> + ResourceExt + Clone + Debug + Serialize + for<'de> Deserialize<'de>,
Expand description

Generic function to delete a DNS record from BIND9 primaries.

This function handles deletion of any record type using the generic approach:

  1. Gets the zone reference from the record’s status
  2. Looks up the DNSZone to get instances
  3. Filters to primary instances
  4. Deletes the record from all primaries

§Arguments

  • client - Kubernetes API client
  • record - The DNS record resource being deleted
  • record_type - Human-readable record type (e.g., “A”, “TXT”)
  • record_type_hickory - hickory-client RecordType enum value
  • stores - Reflector stores containing DNSZones and instances

§Returns

Returns Ok(()) if deletion succeeded (or if record didn’t exist).

§Errors

Returns an error if instance lookup fails or DNS deletion fails critically.

§Panics

Panics if RNDC key is not found for an instance (should never happen in production).