fix(go.d): prefer env-provided dirs over build-time defaults by ilyam8 · Pull Request #21345 · netdata/netdata

Summary

Fixes #21343

Test Plan
Additional Information
For users: How does this change affect me?

Summary by cubic

Prioritizes environment-provided config directories in go.d over build-time defaults, so runtime overrides take effect. In terminal runs, ignores env-provided dirs and watch path to prevent accidental overrides.

  • Bug Fixes
    • User config: initUserRoots now checks NETDATA_USER_CONFIG_DIR (env) before buildinfo.UserConfigDir.
    • Stock config: initStockRoot now uses the env-provided stock config dir first, then buildinfo.StockConfigDir, then the relative fallback.
    • Terminal runs: if stdout/stderr is a TTY, ignore NETDATA_USER_CONFIG_DIR, NETDATA_STOCK_CONFIG_DIR, and NETDATA_PLUGINS_GOD_WATCH_PATH.

Written for commit 9fb07ce. Summary will update automatically on new commits.