Render forward zones into named.conf on every pod
type:forward zones are pure configuration (conditional forwarding), not replicated data, so a resolver needs them on all pods. They were being rndc-addzone'd on the primary only, so queries hitting a secondary pod missed the forwarding. Render them into named.conf instead. - render forward zones inside their view (or top-level when no views) - BindCluster lists type:forward zones and watches BindZone to re-render - BindZone controller skips forward zones (config-managed, no addzone) - unit test for forward-zone-in-view rendering
This commit is contained in:
@@ -35,6 +35,19 @@ func (r *BindZoneReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c
|
||||
return ctrl.Result{}, client.IgnoreNotFound(err)
|
||||
}
|
||||
|
||||
// Forward zones are pure configuration rendered into named.conf by the
|
||||
// BindCluster controller (on every pod), not added dynamically to the
|
||||
// primary. Nothing to do here beyond reporting readiness.
|
||||
if zone.Spec.Type == bindv1alpha1.ZoneForward {
|
||||
zone.Status.Phase = "Ready"
|
||||
zone.Status.ObservedGeneration = zone.Generation
|
||||
setReady(&zone.Status.Conditions, zone.Generation, true, "Configured", "forward zone rendered into named.conf")
|
||||
if err := r.Status().Update(ctx, &zone); err != nil {
|
||||
return ctrl.Result{}, err
|
||||
}
|
||||
return ctrl.Result{}, nil
|
||||
}
|
||||
|
||||
cluster, err := getCluster(ctx, r.Client, zone.Namespace, zone.Spec.ClusterRef)
|
||||
if err != nil {
|
||||
return r.setPhase(ctx, &zone, "Error", "ClusterMissing", err.Error())
|
||||
|
||||
Reference in New Issue
Block a user