Documentation
¶
Overview ¶
Package catalog is the CatalogService reconciler (ADR-0086 as reworked by ADR-0087, F48/F57): the ADR-0019 controller half of the DuckLake/DuckDB/Quack add-on provider. Its engine is NO longer a backing Function — it is deployed by the add-on-provider runtime (internal/provider, ADR-0087): the reconciler resolves the service's bindings (spec.blob → the ADR-0085 per-fn S3 keypair derived over the provider identity; spec.catalog → FUNCD_DUCKLAKE_CATALOG; spec.secrets/spec.config → the Quack token + engine config) into a provider.ProviderSpec and calls provider.Runtime.Converge. It reflects the provider's readiness/address into status and tears the engine down on delete. cgo never touches the daemon — DuckDB runs out-of-process in the curated image.
Index ¶
Constants ¶
const DuckDBRuntime = "duckdb"
DuckDBRuntime is the curated runtime name whose image the reconciler deploys the engine from (ADR-0086/0087 / ADR-0054 embedded-image set). ImageFor(DuckDBRuntime) → the real DuckDB 1.5.4 + ducklake/httpfs/quack image ref (node-built out-of-band; in-process the engine never reaches Ready, which is expected — the live engine comes up only on the node-gated lane).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reconciler ¶
type Reconciler struct {
// contains filtered or unexported fields
}
Reconciler is the controller.Reconciler for KindCatalogService (ADR-0086/0087): present ⇒ assemble a provider.ProviderSpec + Converge the engine via the provider-runtime + reflect status; absent (deleted) ⇒ Teardown the engine.
func NewReconciler ¶
func NewReconciler(d ReconcilerDeps) (*Reconciler, error)
NewReconciler builds the CatalogService reconciler. Store + Provider are required.
func (*Reconciler) Reconcile ¶
func (r *Reconciler) Reconcile(ctx context.Context, req controller.Request) (controller.Result, error)
Reconcile converges one CatalogService (ADR-0086 as reworked by ADR-0087). A present CatalogService is deployed as an add-on provider: the reconciler assembles a provider.ProviderSpec from its bindings (spec.blob → the ADR-0085 per-fn S3 keypair derived over the provider identity; spec.catalog → FUNCD_DUCKLAKE_CATALOG; spec.secrets/spec.config → the Quack token + engine config) and calls the provider-runtime's Converge — NO backing Function is materialized. It reflects the provider's readiness/address into status. A deleted CatalogService (NotFound) tears the engine down via provider.Teardown.
The reconciler writes NO data — DuckDB does, out-of-process, through the F47 S3 surface. In-process the engine never reaches Ready (no real image / no probe answerer), which is expected: the live DuckDB scenarios run on the deferred node-gated lane.
type ReconcilerDeps ¶
type ReconcilerDeps struct {
Store store.Store
Provider provider.Runtime
Logger *slog.Logger
// Derive returns the deterministic per-(ns, name) SigV4 keypair (ADR-0085), derived over the
// PROVIDER identity (ns, cs.Name). nil ⇒ no S3 keypair injected. Same shape the Function
// reconciler's S3GatewayInjection.Derive carries.
Derive func(ns, name string) (access, secret string)
// Secrets resolves spec.secrets → env (the Quack token, ADR-0057). nil ⇒ a service declaring
// spec.secrets fails closed.
Secrets SecretResolver
// DeveloperFor returns the PDP identity the secret reads are authorized as (ADR-0057). Defaulted
// to the namespace-scoped developer identity when Secrets is set and this is nil.
DeveloperFor func(ns v1.NamespaceName) auth.Identity
// S3Endpoint is the sandbox-facing S3 URL injected as AWS_ENDPOINT_URL_S3 (ADR-0085). Empty ⇒
// the var is unset.
S3Endpoint string
// ImageFor maps a curated runtime name → the engine image ref (ADR-0054). nil ⇒ a deterministic
// fallback "funcd/runtime-<runtime>" is used.
ImageFor func(runtime string) string
// Proxy runs the per-CatalogService node-private catalog PEP proxy (ADR-0137): on the Ready
// branch the reconciler Ensures a proxy fronting the engine and publishes ITS url as
// Status.Endpoint (internal functions inject the proxy, not the engine), and Removes it on
// teardown. nil ⇒ no internal PEP proxy (the engine address is published directly, the
// pre-ADR-0137 posture) — kept nil-safe for the in-memory/unit path.
Proxy *cataloggw.Manager
// Routes contributes this catalog's OPT-IN external ingress entry (source "catalog/<ns>/<name>")
// to the shared edge-router aggregator (ADR-0138). When spec.ingress is set and the catalog is
// Ready, the reconciler programs an edge entry whose Upstream is the PEP PROXY (never the engine);
// cleared on not-Ready / delete. nil ⇒ no external exposure (the in-memory/dev path).
Routes router.EntrySetter
// SupervisionPeriod is the requeue of a Ready CatalogService (ADR-0142); 0 ⇒ controller.SupervisionPeriod.
SupervisionPeriod time.Duration
}
ReconcilerDeps configures the KindCatalogService reconciler (ADR-0086/0087). Store + Provider are required; the rest tune the engine env (the bindings the ADR injects). When Derive/Secrets are nil the corresponding env is simply absent (in-memory/dev) — the engine still deploys but can't reach S3 / authenticate (it never reaches Ready in-process anyway).
type SecretResolver ¶
type SecretResolver interface {
ResolveEnv(ctx context.Context, id auth.Identity, ns v1.NamespaceName, names []string) (map[string]string, error)
}
SecretResolver resolves a service's bound Secret names → an env-var map for engine injection, PDP-authorized for id (ADR-0022/0057). The reconciler depends on this local seam (ADR-0002 import discipline) — satisfied by *secrets.Resolver, wired in pkg/funcd. A nil resolver disables secret injection: a CatalogService that declares spec.secrets then fails closed (not Ready).