Skip to content

endpoint: a failed observation retains generated records; record withdrawal transitions (APT-866) - #27

Merged
reoring merged 1 commit into
mainfrom
pubcont-w1d-conversion-error-retain
Nov 13, 2026
Merged

reoring merged 1 commit into
mainfrom
pubcont-w1d-conversion-error-retain

Conversation

@reoring

@reoring reoring commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

What

A failed read or conversion no longer becomes "nothing desired" followed by pruning, and every withdrawal transition is recorded (platform ADR-0083 revision 6, rules R5 and R6; tracker APT-866).

Error is not rejection (endpoint-recordset controller)

Each hostname now resolves to one of three typed outcomes:

Outcome Examples Effect
resolved — generated children are applied
rejected provider InvalidInput / UnsupportedTarget (non-retryable), invalid generated name, observed Zone policy denial children of that hostname are pruned (unchanged)
pending no Zone suffix match, missing or ambiguous EndpointProviderCapability typed per-hostname status as before, no error, other hostnames converge, existing children of that hostname are excluded from pruning (never recreated)

A genuine failure (List/Get error, conversion transport error including 401/403, malformed response, UID mismatch, retryable or unknown conversion failure, missing REST config) aborts the pass, retains every child, and reports Resolved=Unknown / Ready=Unknown while keeping Accepted, Programmed and the previous child snapshot.

Before: convertEndpointRecordSet returned (nil, message, nil) for API errors, recordSetsForHostname treated that as a rejected candidate, and applyRecordSets deleted the existing children. One transient API error could withdraw the records of a serving name.

Shared helpers return what happened

  • declaration.RecordSetAllowedByZone and WithdrawalAllowedByZone return the Namespace read error instead of false. Callers migrated: endpoint controller, core ZoneUnit composition, core withdrawal composition. A read error now retains instead of composing NotAllowed.
  • retirement.RetireOrDelete returns a typed outcome (Patched, Deleted, NoChange) with its error. Callers migrated: gateway-endpoint and service-endpoint controllers.

Transition records

One log line and one Event, on the successful transition only: HostnameRemoved, EndpointRecordSetRetired, EndpointRecordSetDeleted, RecordSetPruned. Failed writes, NotFound and repeated reconciles of a terminating object emit nothing. The manager ClusterRole already grants events create/patch.

Not changed

Provider controllers; the D4 retention rule from #26. Route 53 has a private namespaceAllowed that still hides Get errors, but it has no production caller.

Behaviour change to review

A hostname whose Zone match or capability disappears keeps its generated RecordSets until the hostname is removed from the EndpointRecordSet, the set is retired, or the hostname is explicitly rejected. Previously they were pruned.

Checks

  • go test ./... -count=1: 38 packages ok. deploy/charts/dns-api TestExternalKustomizeParity fails on this workstation with and without the change because kustomize is not installed; left to CI.
  • go vet ./internal/go/...: clean
  • git diff --check: clean
  • Live Event delivery was not exercised.

@reoring

reoring commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

Owner review: approved by reoring in the supervising session (2026-11-13, "ほかのreview は ok"). Merging on that approval.

@reoring
reoring merged commit 64a4e1a into main Nov 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant