Skip to content

Commit 1782991

Browse files
feat(config): connect rule and endpoint keys
1 parent b7bed6b commit 1782991

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

config/config.go

+9
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,15 @@ func (p Parser) Parse(raw Raw) (Config, error) {
254254
ruleToEndpoints[key] = value.Endpoints
255255
rules = append(rules, r)
256256
}
257+
258+
// Special case where if the keys of rules and endpoints match then we should assume the user wants them to be connected
259+
for endKey := range raw.Endpoints {
260+
for ruleKey := range raw.Rules {
261+
if ruleKey == endKey {
262+
ruleToEndpoints[ruleKey] = append(ruleToEndpoints[ruleKey], endKey)
263+
}
264+
}
265+
}
257266
}
258267

259268
var timeHourFormat string

0 commit comments

Comments
 (0)