From 92bea5aad258ca740978dfacde397ef04df75ff8 Mon Sep 17 00:00:00 2001 From: Link Dupont Date: Thu, 12 Sep 2024 17:19:46 -0400 Subject: [PATCH] fix: Include hyphenated worker names When publishing the dispatchers table, include both underscore names and classic hyphenated names. --- internal/work/dispatcher.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/work/dispatcher.go b/internal/work/dispatcher.go index 22193fae..82254991 100644 --- a/internal/work/dispatcher.go +++ b/internal/work/dispatcher.go @@ -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