pub async fn reconcile_dnszone(
client: Client,
dnszone: DNSZone,
zone_manager: &Bind9Manager,
) -> Result<()>Expand description
Reconciles a DNSZone resource.
Creates or updates DNS zone files on BIND9 instances that match the zone’s instance selector. Supports both primary and secondary zone types.
§Zone Types
- Primary: Authoritative zone with SOA record and local zone file
- Secondary: Replica zone that transfers from primary servers
§Arguments
client- Kubernetes API client for finding matchingBind9Instancesdnszone- TheDNSZoneresource to reconcilezone_manager- BIND9 manager for creating zone files
§Returns
Ok(())- If zone was created/updated successfullyErr(_)- If zone creation failed or configuration is invalid
§Example
use bindy::reconcilers::reconcile_dnszone;
use bindy::crd::DNSZone;
use bindy::bind9::Bind9Manager;
use kube::Client;
async fn handle_zone(zone: DNSZone) -> anyhow::Result<()> {
let client = Client::try_default().await?;
let manager = Bind9Manager::new();
reconcile_dnszone(client, zone, &manager).await?;
Ok(())
}§Errors
Returns an error if Kubernetes API operations fail or BIND9 zone operations fail.