We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d05208b commit da7c143Copy full SHA for da7c143
1 file changed
internals/discovery/discovery.go
@@ -212,12 +212,20 @@ func getRouterHosts(container container.Summary) map[string][]string {
212
return nil
213
}
214
215
- for key, value := range container.Labels {
216
- router := routerRegex.FindString(key)
217
- if router != "" {
218
- hosts[router] = hostRegex.FindStringSubmatch(value)
219
- }
220
+ for key, value := range container.Labels {
+ routerMatch := routerRegex.FindStringSubmatch(key)
+ if len(routerMatch) < 2 {
+ continue
+ }
+ router := routerMatch[1]
221
+
222
+ matches := hostRegex.FindAllStringSubmatch(value, -1)
223
+ for _, match := range matches {
224
+ if len(match) >= 2 {
225
+ hosts[router] = append(hosts[router], match[1])
226
227
228
229
230
return hosts
231
0 commit comments