Documentation
¶
Overview ¶
Package networkroute provides the NetworkRoute Sync Controller for managing Cloudflare Tunnel Routes. Unlike TunnelConfigSyncController which aggregates multiple sources, NetworkRouteSyncController handles individual routes 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 Network Routes. It handles create, update, and delete operations based on SyncState changes.
Index ¶
Constants ¶
const ( // FinalizerName is the finalizer for NetworkRoute SyncState resources. // This ensures we delete the NetworkRoute from Cloudflare before removing SyncState. FinalizerName = "networkroute.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 NetworkRoute Configuration. It watches CloudflareSyncState resources of type NetworkRoute, extracts the configuration, and syncs to Cloudflare API. This is the SINGLE point that calls Cloudflare NetworkRoute API.
func NewController ¶
func NewController(c client.Client) *Controller
NewController creates a new NetworkRouteSyncController
func (*Controller) Reconcile ¶
Reconcile processes a CloudflareSyncState resource for NetworkRoute. 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 NetworkRoute 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.