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:
- Gets the zone reference from the record’s status
- Looks up the
DNSZoneto get instances - Filters to primary instances
- Deletes the record from all primaries
§Arguments
client- Kubernetes API clientrecord- The DNS record resource being deletedrecord_type- Human-readable record type (e.g., “A”, “TXT”)record_type_hickory- hickory-clientRecordTypeenum valuestores- Reflector stores containingDNSZonesand 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).