mirror of
https://github.com/hanzoai/dns.git
synced 2026-10-30 18:40:55 +00:00
Implement the stubbed CloudflareReconciler with real CF DNS sync (create/
adopt/update/delete via a finalizer) so DnsRecords with syncToCloudflare=true
land at the edge, and add a PagesProject CR + reconciler that deploys a CF
Pages site, attaches its custom domain, and wires DNS by composing the DNS
layer (emits an owned CNAME DnsRecord rather than a second CF-DNS code path).
- internal/cloudflare: minimal CF API v4 client (DNS CRUD + Pages), one do()
HTTP path, scoped Bearer auth, idempotent delete/add. httptest-covered.
- CloudflareReconciler: real upsert + finalizer cleanup; nil client => no-op.
- PagesProject{,Spec,Status} CR + reconciler (Owns child DnsRecord for GC).
- main.go: one shared cloudflare.Client injected into both reconcilers.
- CRDs, RBAC, DeepCopy regenerated; deployable manager manifest (CF_API_TOKEN
from KMS-synced secret, optional); hanzo.bot sample.
Tests: go test ./... green (CF client + both reconcilers, fake client + mock CF).
31 lines
417 B
YAML
31 lines
417 B
YAML
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: ClusterRole
|
|
metadata:
|
|
name: manager-role
|
|
rules:
|
|
- apiGroups:
|
|
- dns.hanzo.ai
|
|
resources:
|
|
- dnsrecords
|
|
- dnszones
|
|
- pagesprojects
|
|
verbs:
|
|
- create
|
|
- delete
|
|
- get
|
|
- list
|
|
- patch
|
|
- update
|
|
- watch
|
|
- apiGroups:
|
|
- dns.hanzo.ai
|
|
resources:
|
|
- dnsrecords/status
|
|
- dnszones/status
|
|
- pagesprojects/status
|
|
verbs:
|
|
- get
|
|
- patch
|
|
- update
|