You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Operator-owned, CR-driven fast deploy for content (.deco/blocks). Two pluggable
interfaces (internal/deploy):
- DeploymentTarget: maps a git push to desired-state CRs. cloudflare-workers impl
resolves the repo's Deco CR and emits a Decofile CR (target: tanstack-kv) on a
content-only push to a fast-deploy-enabled site.
- FastDeployment: drives a Decofile CR to its effect. tanstack-kv impl creates a
self-cleaning batch/v1 Job (decofile-syncer image) that pushes the decofile to
Cloudflare KV; the existing ConfigMap/Knative path stays the default.
Adds POST /webhooks/github (HMAC-verified, outside basic-auth) to the operator
API; Decofile CRD gains target/tanstackKV; Deco CRD gains fastDeploy; Decofile
reconciler dispatches non-configmap targets and owns Jobs (batch RBAC).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
// DecoFastDeploy configures KV-first content fast-deploy for a site.
49
+
// +kubebuilder:validation:XValidation:rule="!self.enabled || (has(self.kvNamespaceId) && size(self.kvNamespaceId) > 0)",message="kvNamespaceId is required when fastDeploy is enabled"
50
+
typeDecoFastDeploystruct {
51
+
// Enabled gates the fast-deploy content path. When false, content pushes take
52
+
// the normal build/deploy path.
53
+
// +optional
54
+
Enabledbool`json:"enabled,omitempty"`
55
+
56
+
// KVNamespaceID is the Cloudflare KV namespace id for this site (one per site).
57
+
// Required when enabled (enforced via the XValidation rule on this struct).
Copy file name to clipboardExpand all lines: api/v1alpha1/decofile_types.go
+48Lines changed: 48 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,24 @@ import (
24
24
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
25
25
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
26
26
27
+
// Decofile source kinds (DecofileSpec.Source).
28
+
const (
29
+
SourceInline="inline"
30
+
SourceGitHub="github"
31
+
)
32
+
33
+
// Decofile delivery targets (DecofileSpec.Target) — selects the FastDeployment
34
+
// strategy that reconciles the CR.
35
+
const (
36
+
// TargetConfigMap writes a ConfigMap + notifies Knative pods (default).
37
+
TargetConfigMap="configmap"
38
+
// TargetTanstackKV runs a Job that pushes the decofile to Cloudflare KV.
39
+
TargetTanstackKV="tanstack-kv"
40
+
)
41
+
27
42
// DecofileSpec defines the desired state of Decofile.
43
+
// +kubebuilder:validation:XValidation:rule="self.target != 'tanstack-kv' || has(self.tanstackKV)",message="spec.tanstackKV is required when target is tanstack-kv"
44
+
// +kubebuilder:validation:XValidation:rule="self.target != 'tanstack-kv' || self.source == 'github'",message="source must be 'github' when target is tanstack-kv"
28
45
typeDecofileSpecstruct {
29
46
// Source specifies where to get the configuration data
30
47
// +kubebuilder:validation:Required
@@ -43,6 +60,33 @@ type DecofileSpec struct {
43
60
// Pods are queried using the app.deco/deploymentId label
44
61
// +optional
45
62
DeploymentIdstring`json:"deploymentId,omitempty"`
63
+
64
+
// Target selects how this Decofile is delivered (the FastDeployment strategy).
65
+
// "configmap" (default) writes a ConfigMap and notifies Knative pods.
66
+
// "tanstack-kv" runs a self-cleaning Job that pushes the decofile to Cloudflare
67
+
// KV — the fast-deploy content path for TanStack/Workers sites.
0 commit comments