Skip to content

controller: use a pointer receiver on patchDNSRecords - #63

Merged
tamalsaha merged 1 commit into
masterfrom
fix/pointer-receiver
Jun 5, 2026
Merged

tamalsaha merged 1 commit into
masterfrom
fix/pointer-receiver

Conversation

@tamalsaha

Copy link
Copy Markdown
Contributor

Summary

patchDNSRecords was declared with a value receiver while every other ExternalDNSReconciler method uses a pointer receiver:

func (r ExternalDNSReconciler) patchDNSRecords(...)  // before
func (r *ExternalDNSReconciler) patchDNSRecords(...) // after

Today benign — the embedded client.Client survives the copy — but the next field added to the struct (a cache, a counter, an unexported mutex) would silently lose its mutations when called through this method.

Test plan

  • go build ./...
  • go vet ./...

All other ExternalDNSReconciler methods use a pointer receiver;
patchDNSRecords was the lone value-receiver outlier. Today benign —
the embedded client.Client survives the copy — but the next field
added to the struct (a cache, a counter, an unexported mutex) would
silently lose its mutations through this path.

Signed-off-by: Tamal Saha <tamal@appscode.com>
@tamalsaha
tamalsaha merged commit 4983157 into master Jun 5, 2026
4 checks passed
@tamalsaha
tamalsaha deleted the fix/pointer-receiver branch June 5, 2026 18:27
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.

2 participants