Skip to content

controller, informers: dedupe secret + source mapping handlers#72

Open
tamalsaha wants to merge 1 commit into
masterfrom
refactor/dedupe-informer-handlers
Open

controller, informers: dedupe secret + source mapping handlers#72
tamalsaha wants to merge 1 commit into
masterfrom
refactor/dedupe-informer-handlers

Conversation

@tamalsaha

Copy link
Copy Markdown
Contributor

Summary

  • Extract `providerSecretName(spec)` so the secret-to-ExternalDNS mapping in `SetupWithManager` stops repeating the same per-provider name check four times.
  • Extract `enqueueForKind(ctx, r, kind)` for the Node/Service/Ingress informer handlers, which all did the same cluster-wide list + Kind filter. The typed predicates differ per kind (Node uses Status.Addresses, others use Generation + Status.LoadBalancer) and stay where they are.

No behavior change.

Test plan

  • `go build ./...`
  • Update a Secret referenced by an ExternalDNS and confirm a single reconcile fires
  • Update an unrelated Node/Service/Ingress label and confirm we still reconcile the matching ExternalDNS

Extract providerSecretName(spec) so the secretToEdns handler stops
repeating the same per-provider name check four times. Behavior is
identical; the switch lives in one place now.

Extract enqueueForKind(ctx, r, kind) for the Node/Service/Ingress
informer handlers. The typed predicates still differ per kind (Node
looks at Status.Addresses, the others look at Generation +
Status.LoadBalancer) and stay where they are.

Signed-off-by: Tamal Saha <tamal@appscode.com>
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