| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Job-name validation policy is now a Callbacks[C] method so each domain declares its rule explicitly. Two reusable helpers live in the framework: - JobNameRuleStrict (collector — no spaces, dots, colons) - JobNameRuleAllowDots (SD, vnode, secretstore — allows dots in names) Removes the package-level dyncfg.ValidateJobName default that was imposing collector rules on all callers, and lets SD/vnode/secretstore accept dotted identifiers (e.g. FQDNs).
|
Sorry, something went wrong.
There was a problem hiding this comment.
No issues found across 12 files
Confidence score: 5/5
sequenceDiagram
participant Client as External API / Netdata Cloud
participant Handler as dyncfg.Handler (Framework)
participant Domain as Callbacks[C] (SD, VNode, Collector)
participant Rules as dyncfg Rules (Validation Helpers)
Note over Client,Rules: Processing "CmdAdd" for Dynamic Configuration
Client->>Handler: CmdAdd(Function fn)
Handler->>Domain: ExtractKey(fn)
Domain-->>Handler: key, job_name, ok
Note over Handler,Domain: NEW: Domain-specific Name Validation
Handler->>Domain: NEW: ValidateJobName(job_name)
alt Domain is Collector
Domain->>Rules: JobNameRuleStrict(job_name)
Rules-->>Domain: error (if dots/spaces/colons)
else Domain is SD / VNode / SecretStore
Domain->>Rules: JobNameRuleAllowDots(job_name)
Rules-->>Domain: error (if spaces/colons)
end
Domain-->>Handler: error status
alt Invalid Name
Handler->>Client: SendCode(400, "invalid job name")
else Valid Name
Handler->>Domain: ParseAndValidate(fn, job_name)
Domain-->>Handler: Config object (C), error
alt Valid Config
Handler->>Domain: Start(C)
Domain-->>Handler: success
Handler->>Client: SendCode(200, "OK")
else Invalid Config
Handler->>Client: SendCode(400, "parse error")
end
end
Note over Handler,Domain: Note: Validation happens before expensive payload parsing.
Sorry, something went wrong.
(cherry picked from commit 531d549)
| Back | FazBrowse Home | New Git URL |
Job-name validation policy is now a Callbacks[C] method so each domain declares its rule explicitly. Two reusable helpers live in the framework:
Removes the package-level dyncfg.ValidateJobName default that was imposing collector rules on all callers, and lets SD/vnode/secretstore accept dotted identifiers (e.g. FQDNs).
Summary
Test Plan
Additional Information
For users: How does this change affect me?Summary by cubic
Split job-name validation by domain in dyncfg. Collectors keep strict names; service discovery, vnode, and secretstore now accept dotted names (e.g., FQDNs).
Refactors
Migration
Written for commit f6e2874. Summary will update on new commits.