mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-20 07:19:17 +01:00
fixes dockerswarm (#1053)
fixes improper usage of host network services https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1028
This commit is contained in:
parent
2aa37b0450
commit
6fc2a8e544
@ -99,6 +99,11 @@ func addServicesLabels(services []service, networksLabels map[string]map[string]
|
||||
commonLabels["__meta_dockerswarm_service_label_"+discoveryutils.SanitizeLabelName(k)] = v
|
||||
}
|
||||
for _, vip := range service.Endpoint.VirtualIPs {
|
||||
// skip services without virtual address.
|
||||
// usually its host services.
|
||||
if vip.Addr == "" {
|
||||
continue
|
||||
}
|
||||
ip, _, err := net.ParseCIDR(vip.Addr)
|
||||
if err != nil {
|
||||
logger.Errorf("cannot parse: %q as cidr for service label add, err: %v", vip.Addr, err)
|
||||
|
Loading…
Reference in New Issue
Block a user