Add provider registry, label-driven dispatch, DigitalOcean provider #2

Merged
thatjames merged 1 commit from pr2/provider-dispatch into main 2026-04-25 18:43:47 +02:00
Owner

Containers now select a DNS backend via a dns.provider= label,
with DEFAULT_DNS_PROVIDER as the fallback when the label is absent.
DockerService is wired through a Registry of providers; the worker
loop resolves the right provider per container and dispatches.

  • internal/providers/registry.go: small Registry (Register/Get/Names)
    rejecting nil, empty, and duplicate names.
  • internal/service/labels.go: pure resolver for label > default > skip.
  • internal/providers/digitalocean: godo-backed provider with idempotent
    EnsureRecord (list, match, edit-or-create), DeleteRecord, HealthCheck,
    redact helper for token-bearing errors, and httptest-driven tests.
  • main.go: reads DNS_PROVIDERS, builds and health-checks each provider
    before registering, validates DEFAULT_DNS_PROVIDER is registered.
  • README documents the new labels and env vars.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

Containers now select a DNS backend via a dns.provider=<name> label, with DEFAULT_DNS_PROVIDER as the fallback when the label is absent. DockerService is wired through a Registry of providers; the worker loop resolves the right provider per container and dispatches. - internal/providers/registry.go: small Registry (Register/Get/Names) rejecting nil, empty, and duplicate names. - internal/service/labels.go: pure resolver for label > default > skip. - internal/providers/digitalocean: godo-backed provider with idempotent EnsureRecord (list, match, edit-or-create), DeleteRecord, HealthCheck, redact helper for token-bearing errors, and httptest-driven tests. - main.go: reads DNS_PROVIDERS, builds and health-checks each provider before registering, validates DEFAULT_DNS_PROVIDER is registered. - README documents the new labels and env vars. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add provider registry, label-driven dispatch, DigitalOcean provider
All checks were successful
deploy / deploy (push) Successful in 1m1s
a94d51a22b
Containers now select a DNS backend via a dns.provider=<name> label,
with DEFAULT_DNS_PROVIDER as the fallback when the label is absent.
DockerService is wired through a Registry of providers; the worker
loop resolves the right provider per container and dispatches.

- internal/providers/registry.go: small Registry (Register/Get/Names)
  rejecting nil, empty, and duplicate names.
- internal/service/labels.go: pure resolver for label > default > skip.
- internal/providers/digitalocean: godo-backed provider with idempotent
  EnsureRecord (list, match, edit-or-create), DeleteRecord, HealthCheck,
  redact helper for token-bearing errors, and httptest-driven tests.
- main.go: reads DNS_PROVIDERS, builds and health-checks each provider
  before registering, validates DEFAULT_DNS_PROVIDER is registered.
- README documents the new labels and env vars.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
thatjames/docker-dns-resolver!2
No description provided.