Skip to content

plan: base defaultConfig on externaldns.NewConfig#73

Merged
tamalsaha merged 1 commit into
masterfrom
refactor/use-upstream-newconfig
Jun 6, 2026
Merged

plan: base defaultConfig on externaldns.NewConfig#73
tamalsaha merged 1 commit into
masterfrom
refactor/use-upstream-newconfig

Conversation

@tamalsaha

Copy link
Copy Markdown
Contributor

Summary

The hand-rolled `defaultConfig` duplicated upstream's CLI defaults and included dozens of explicit zero-value lines.

Replace it with `newDefaultConfig()` that:

  • starts from `externaldns.NewConfig()` so anything upstream adds with a non-zero default in NewConfig flows in automatically;
  • only assigns fields whose desired default differs from the Go zero value (the file shrinks ~100 lines);
  • retains the kingpin-flag defaults the operator still mimics, with a comment flagging that those need manual tracking until we can adopt upstream's flag binder directly.

Behavior preserved: previously-explicit zero values are now implicit; meaningful defaults (regex filters, owner ID, intervals, etc.) are kept verbatim.

Test plan

  • `go build ./...`
  • Reconcile an ExternalDNS for each provider and confirm the resulting plan / DNS records are unchanged

The hand-rolled defaultConfig duplicated upstream's CLI defaults and
made every line of upstream's Config visible — including dozens of
explicit zero-value lines that added noise without adding meaning.

Replace it with newDefaultConfig(), which:
  - starts from externaldns.NewConfig() so any new defaulted field
    upstream adds in NewConfig flows in automatically;
  - only assigns fields whose desired default differs from the Go zero
    value (so the file shrinks substantially);
  - retains the kingpin-flag defaults the operator still mimics, with a
    comment flagging that those need to be tracked manually until we
    can adopt the upstream binder directly.

Behavior is preserved: previously-explicit zero values are now implicit,
and the meaningful defaults (regex filters, owner ID, intervals, etc.)
are kept verbatim.

Signed-off-by: Tamal Saha <tamal@appscode.com>
@tamalsaha tamalsaha merged commit 7eb2448 into master Jun 6, 2026
4 checks passed
@tamalsaha tamalsaha deleted the refactor/use-upstream-newconfig branch June 6, 2026 16:07
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