agent icon indicating copy to clipboard operation
agent copied to clipboard

Add NGINX Agent config validation

Open dhurley opened this issue 10 months ago • 0 comments

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.conf file.

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 CONTRIBUTING document
  • [ ] I have run make install-tools and 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

dhurley avatar Apr 04 '25 14:04 dhurley