Documentation
¶
Overview ¶
Package pages provides the Pages Sync Controllers for managing Cloudflare Pages resources. Each controller handles a specific resource type: Project, Domain, and Deployment.
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 Pages projects.
Index ¶
Constants ¶
const (
// DeploymentFinalizerName is the finalizer for Pages Deployment SyncState resources.
DeploymentFinalizerName = "pages-deployment.sync.cloudflare-operator.io/finalizer"
)
const (
// DomainFinalizerName is the finalizer for Pages Domain SyncState resources.
DomainFinalizerName = "pages-domain.sync.cloudflare-operator.io/finalizer"
)
const (
// ProjectFinalizerName is the finalizer for Pages Project SyncState resources.
ProjectFinalizerName = "pages-project.sync.cloudflare-operator.io/finalizer"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeploymentResult ¶
type DeploymentResult struct {
DeploymentID string
URL string
Stage string
// HashURL is the unique hash-based URL for this deployment.
// Format: <hash>.<project>.pages.dev
HashURL string
// BranchURL is the branch-based URL for this deployment.
// Format: <branch>.<project>.pages.dev
BranchURL string
// Environment is the deployment environment (production or preview)
Environment string
// IsCurrentProduction indicates if this is the current active production deployment
IsCurrentProduction bool
// Version is the sequential version number within the project
Version int
// SourceHash is the SHA-256 hash of the source package (for direct upload).
SourceHash string
// SourceURL is the URL where source was fetched from (for direct upload).
SourceURL string
// K8sResource identifies the K8s resource that created this deployment.
// Format: "namespace/name"
K8sResource string
// Source describes the deployment source type.
// Examples: "direct-upload:http", "git:main", "rollback:v5"
Source string
}
DeploymentResult contains the result of a deployment action.
type DeploymentSyncController ¶
type DeploymentSyncController struct {
*common.BaseSyncController
}
DeploymentSyncController is the Sync Controller for Pages Deployment Configuration. It watches CloudflareSyncState resources of type PagesDeployment, extracts the configuration, and syncs to Cloudflare API. This is the SINGLE point that calls Cloudflare Pages Deployment API.
func NewDeploymentSyncController ¶
func NewDeploymentSyncController(c client.Client) *DeploymentSyncController
NewDeploymentSyncController creates a new DeploymentSyncController
func (*DeploymentSyncController) Reconcile ¶
func (r *DeploymentSyncController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile processes a CloudflareSyncState resource for Pages deployment.
func (*DeploymentSyncController) SetupWithManager ¶
func (r *DeploymentSyncController) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type DomainSyncController ¶
type DomainSyncController struct {
*common.BaseSyncController
}
DomainSyncController is the Sync Controller for Pages Domain Configuration. It watches CloudflareSyncState resources of type PagesDomain, extracts the configuration, and syncs to Cloudflare API. This is the SINGLE point that calls Cloudflare Pages Domain API.
func NewDomainSyncController ¶
func NewDomainSyncController(c client.Client) *DomainSyncController
NewDomainSyncController creates a new DomainSyncController
func (*DomainSyncController) Reconcile ¶
func (r *DomainSyncController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile processes a CloudflareSyncState resource for Pages domain.
func (*DomainSyncController) SetupWithManager ¶
func (r *DomainSyncController) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type ProjectSyncController ¶
type ProjectSyncController struct {
*common.BaseSyncController
}
ProjectSyncController is the Sync Controller for Pages Project Configuration. It watches CloudflareSyncState resources of type PagesProject, extracts the configuration, and syncs to Cloudflare API. This is the SINGLE point that calls Cloudflare Pages Project API.
func NewProjectSyncController ¶
func NewProjectSyncController(c client.Client) *ProjectSyncController
NewProjectSyncController creates a new ProjectSyncController
func (*ProjectSyncController) Reconcile ¶
func (r *ProjectSyncController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile processes a CloudflareSyncState resource for Pages project.
func (*ProjectSyncController) SetupWithManager ¶
func (r *ProjectSyncController) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.