networkroute

package
v0.23.1 Latest Latest
Warning

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

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

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

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

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

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.

Jump to

Keyboard shortcuts

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