Sort render inputs so config is deterministic (stop restart loop) #11
Reference in New Issue
Block a user
Delete Branch "benvin/deterministic-render"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why — urgent
After v0.2.2 (config-hash),
bind-resolvers-2is stuck in an endless rolling restart. Root cause: the rendered config is non-deterministic.client.Listreturns cache-ordered results, so the resolver's ~20 forward zones (and DNSSEC policies) reshuffle between reconciles. Before the config hash this was invisible; now a reshuffled render rewrites the ConfigMap → flipsbind.unkin.net/config-hash→ the StatefulSet re-rolls the pod, forever.Confirmed on-cluster: the config-hash annotation and ConfigMap resourceVersion change every reconcile (~3s).
Fix
Sort every list rendered into
named.conf(ACLs, views, forward zones, policies, DNSSEC policies) before rendering, so identical inputs always produce byte-identical config and the hash is stable. ACLs/views were already sorted locally; forward zones and DNSSEC policies were not.Tests
TestRenderDeterministicWithShuffledForwards: two different forward-zone input orders render byte-identical output. Full suite green.Deploy
Needs v0.2.3 + argocd bump. Once the deterministic operator reconciles, the ConfigMap stops churning, the hash stabilizes, and the stuck resolver rolling update completes.