pub async fn reconcile_dnszone(
ctx: Arc<Context>,
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 bindy::context::Context;
use std::sync::Arc;
async fn handle_zone(ctx: Arc<Context>, zone: DNSZone) -> anyhow::Result<()> {
let manager = Bind9Manager::new();
reconcile_dnszone(ctx, zone, &manager).await?;
Ok(())
}§Errors
Returns an error if Kubernetes API operations fail or BIND9 zone operations fail.