Documentation
¶
Overview ¶
Package dns provides the DNS Sync Controller for managing Cloudflare DNS records. Unlike TunnelConfigSyncController which aggregates multiple sources, DNSSyncController handles individual DNS records with a 1:1 mapping.
Unified Sync Architecture Flow: K8s Resources → Resource Controllers → Core Services → SyncState CRD → Sync Controllers → Cloudflare API
This Sync Controller is the SINGLE point that calls Cloudflare API for DNS records. It handles create, update, and delete operations based on SyncState changes.
Index ¶
Constants ¶
const ( // FinalizerName is the finalizer for DNS SyncState resources. // This ensures we delete the DNS record from Cloudflare before removing SyncState. FinalizerName = "dns.sync.cloudflare-operator.io/finalizer" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
*common.BaseSyncController
}
Controller is the Sync Controller for DNS Record Configuration. It watches CloudflareSyncState resources of type DNSRecord, extracts the configuration, and syncs to Cloudflare API. This is the SINGLE point that calls Cloudflare DNS API.
func NewController ¶
func NewController(c client.Client) *Controller
NewController creates a new DNSSyncController
func (*Controller) Reconcile ¶
Reconcile processes a CloudflareSyncState resource for DNS record. Following Unified Sync Architecture: K8s Resources → Resource Controllers → Core Services → SyncState CRD → Sync Controllers → Cloudflare API
The reconciliation flow: 1. Get the SyncState resource 2. Handle deletion (if being deleted or no sources) 3. Add finalizer for cleanup 4. Check for debounce 5. Extract DNS record configuration 6. Compute hash for change detection 7. If changed, sync to Cloudflare API 8. Update SyncState status
func (*Controller) SetupWithManager ¶
func (r *Controller) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.