When implementing dynamic configuration options, validate that the system actually supports runtime changes for that setting. A configuration should only be marked as dynamic if:
When implementing dynamic configuration options, validate that the system actually supports runtime changes for that setting. A configuration should only be marked as dynamic if:
Example of proper dynamic config implementation:
// Good: Dynamic config that's actually monitored
allowRecovery = viperutil.Configure(
"allow-recovery",
viperutil.Options[bool]{
FlagName: "allow-recovery",
Default: true,
Dynamic: true, // System actively checks this value
}
)
// Bad: Misleading dynamic flag
discoveryMaxConcurrency = viperutil.Configure(
"discovery-max-concurrency",
viperutil.Options[int]{
FlagName: "discovery-max-concurrency",
Default: 300,
Dynamic: true, // Wrong! Value only checked during initialization
}
)
For backwards compatibility, carefully consider default values and document any runtime limitations. When in doubt, mark as static rather than potentially misleading users about dynamic capabilities.
Enter the URL of a public GitHub repository