File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -212,12 +212,20 @@ func getRouterHosts(container container.Summary) map[string][]string {
212212 return nil
213213 }
214214
215- for key , value := range container .Labels {
216- router := routerRegex .FindString (key )
217- if router != "" {
218- hosts [router ] = hostRegex .FindStringSubmatch (value )
219- }
220- }
215+ for key , value := range container .Labels {
216+ routerMatch := routerRegex .FindStringSubmatch (key )
217+ if len (routerMatch ) < 2 {
218+ continue
219+ }
220+ 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+ }
221229
222230 return hosts
223231}
You can’t perform that action at this time.
0 commit comments