agent
agent copied to clipboard
Add NGINX Agent config validation
Proposed changes
- Improved logging to tell user what line in the agent config file is incorrect.
- Agent now detects if a field in the config is unknown.
- Updated default
nginx-agent.conffile.
Example log messages:
2025/04/04 15:18:17 ERROR Failed to load configuration file error="[31:1] unknown field \"unknown_field\""
2025/04/04 15:19:07 ERROR Failed to load configuration file error="[25:11] cannot unmarshal string into Go struct field Config.Command of type int"
Checklist
Before creating a PR, run through this checklist and mark each as complete.
- [ ] I have read the
CONTRIBUTINGdocument - [ ] I have run
make install-toolsand have attached any dependency changes to this pull request - [ ] If applicable, I have added tests that prove my fix is effective or that my feature works
- [ ] If applicable, I have checked that any relevant tests pass after adding my changes
- [ ] If applicable, I have updated any relevant documentation (
README.md) - [ ] If applicable, I have tested my cross-platform changes on Ubuntu 22, Redhat 8, SUSE 15 and FreeBSD 13