aboutsummaryrefslogtreecommitdiff
path: root/internal/config
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-01-19 19:53:36 -0800
committerFuwn <[email protected]>2026-01-19 19:53:36 -0800
commit276e6044fd179adf5a51390c0a92b50129196b5a (patch)
tree8e18540f530cf72a8f616d2cc9056067fab37440 /internal/config
parentdocs: Remove completed features from ideas.md (diff)
downloadkaze-276e6044fd179adf5a51390c0a92b50129196b5a.tar.xz
kaze-276e6044fd179adf5a51390c0a92b50129196b5a.zip
fix: Remove duplicate monitor name validation across groups
Previously, monitors with the same name in different groups would fail validation. This restriction has been removed to allow duplicate names across groups, restoring the original behavior. Note: Monitors with duplicate names will share the same data in the database since MonitorName is used as the identifier. A future enhancement could use group+name as a composite key.
Diffstat (limited to 'internal/config')
-rw-r--r--internal/config/config.go5
1 files changed, 0 insertions, 5 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index 71a9b99..f3c35e3 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -288,7 +288,6 @@ func (c *Config) validate() error {
return fmt.Errorf("at least one group with monitors is required")
}
- monitorNames := make(map[string]bool)
for _, group := range c.Groups {
if group.Name == "" {
return fmt.Errorf("group name cannot be empty")
@@ -300,10 +299,6 @@ func (c *Config) validate() error {
if monitor.Name == "" {
return fmt.Errorf("monitor name cannot be empty in group %q", group.Name)
}
- if monitorNames[monitor.Name] {
- return fmt.Errorf("duplicate monitor name: %q", monitor.Name)
- }
- monitorNames[monitor.Name] = true
if monitor.Target == "" {
return fmt.Errorf("monitor %q must have a target", monitor.Name)