Skip to content

Conversation

@nader-ziada
Copy link
Collaborator

@nader-ziada nader-ziada commented Nov 28, 2025

follow up to PRs: #493 , #502 and #520

fixes #548

Add support for flexible configuration management through both main config files and drop-in directories

  • Load config from --config (main file) and --config-dir (drop-in directory)
  • Drop-in files processed in alphabetical order for predictable overrides
  • Partial configuration support - drop-in files can override specific values
  • Dynamic configuration reload via SIGHUP signal
  • SIGHUP support requires either --config or --config-dir flag at startup

@nader-ziada nader-ziada force-pushed the server-drop-in-config branch from 47f2db7 to 8b5f7c4 Compare December 1, 2025 14:42
@manusa manusa self-assigned this Dec 2, 2025
Add support for flexible configuration management through both main config files and drop-in directories

- Load config from --config (main file) and --config-dir (drop-in directory)
- Drop-in files processed in alphabetical order for predictable overrides
- Partial configuration support - drop-in files can override specific values
- Dynamic configuration reload via SIGHUP signal
- SIGHUP support requires either --config or --config-dir flag at startup

Signed-off-by: Nader Ziada <[email protected]>
…ests

Refactors drop-in configuration loading to use deep merge strategy:
- Add DefaultDropInConfigDir constant ("conf.d") for auto-discovery
- Implement deepMerge() for recursive merging of nested config maps
- Merge raw TOML maps before parsing to preserve extended configs
  (cluster_provider_configs, toolset_configs) across multiple drop-ins
- Simplify Read() signature to (configPath, dropInConfigDir string)
- Auto-resolve relative drop-in paths against config file directory

Add comprehensive test coverage:
- Unit tests for deepMerge() function (flat, nested, type mismatch, arrays)
- Tests for default conf.d auto-discovery and resolution
- Tests for standalone --config-dir mode without main config
- Tests for extended config merging across multiple drop-in files
- SIGHUP signal handler integration tests verifying:
  - Config reload from file triggers tool updates
  - Drop-in directory changes are reloaded
  - Invalid config gracefully continues with old config
  - Config-dir only mode works with SIGHUP

Signed-off-by: Marc Nuri <[email protected]>
Copy link
Member

@manusa manusa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created a PR to your branch with some refactors and test suites:

nader-ziada#1

feat(config)!: add deep merge for drop-in configs and SIGHUP reload tests
@manusa manusa added this to the 0.1.0 milestone Dec 4, 2025
Copy link
Member

@manusa manusa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thx!

Use build tag instead of runtime skip to exclude Unix-specific
SIGHUP signal tests from Windows builds.

Signed-off-by: Marc Nuri <[email protected]>
@manusa manusa merged commit 2e922d6 into containers:main Dec 4, 2025
6 checks passed
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.

[CONFIG] Add drop-in configuration support with conf.d directory

2 participants