Skip to content

controller, informers: validate source kind up front#75

Open
tamalsaha wants to merge 1 commit into
masterfrom
fix/validate-source-kind
Open

controller, informers: validate source kind up front#75
tamalsaha wants to merge 1 commit into
masterfrom
fix/validate-source-kind

Conversation

@tamalsaha

Copy link
Copy Markdown
Contributor

Summary

A typo in `spec.source.type.kind` would only surface as a vague "unknown kind" from informer registration — or worse, get lower-cased and passed opaquely to upstream and fail mysteriously.

  • New `informers.ValidateSourceKind` listing the supported set (`Node`, `Service`, `Ingress`).
  • Reconcile calls it at the top so the user sees a clear "unsupported source kind X (supported: [...])" message in Status and the Failed phase is set immediately.

Test plan

  • `go build ./...`
  • Create an ExternalDNS with kind: "Pod" and confirm Status shows the new error + Failed phase

Previously a typo in spec.source.type.kind would only surface as
"unknown kind" from the informer registration step, or worse — pass
through to upstream as a lowercased opaque string and fail
mysteriously downstream.

Add informers.ValidateSourceKind and call it at the top of Reconcile,
before credentials/plan run, so the user sees a clear "unsupported
source kind X (supported: [Node Service Ingress])" message in the
Status condition and the failed phase is set immediately.

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