Skip to content

Commit

Permalink
fix: Include hyphenated worker names
Browse files Browse the repository at this point in the history
When publishing the dispatchers table, include both underscore names
and classic hyphenated names.
  • Loading branch information
subpop committed Sep 13, 2024
1 parent 8eb214b commit 66778b8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/work/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,11 @@ func (d *Dispatcher) FlattenDispatchers() map[string]map[string]string {
dispatchers := make(map[string]map[string]string)
d.features.Visit(func(k string, v map[string]string) {
dispatchers[k] = v
// Include a second entry in the dispatchers map replacing any
// underscores with hyphens to support the "legacy" names of workers.
// This cannot cause any conflict with existing/local workers since
// hyphens in worker names is disallowed by the D-Bus name policy.
dispatchers[strings.ReplaceAll(k, "_", "-")] = v
})

return dispatchers
Expand Down

0 comments on commit 66778b8

Please sign in to comment.