dns

package
v0.25.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

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

View Source
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

func (r *Controller) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL