Don't put v4 addresses in brackets (#506)
authorBrian Brazil <brian.brazil@robustperception.io>
Tue, 6 Aug 2019 20:52:23 +0000 (21:52 +0100)
committerGitHub <noreply@github.com>
Tue, 6 Aug 2019 20:52:23 +0000 (21:52 +0100)
Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
go.mod
go.sum
prober/http.go
vendor/github.com/alecthomas/template/go.mod [new file with mode: 0644]
vendor/github.com/alecthomas/units/go.mod [new file with mode: 0644]
vendor/modules.txt

diff --git a/go.mod b/go.mod
index 43eaa162d397fb2b7bcc31f9340fe38d37f53384..bfae6ec0aeafa55f6a8158bc5fa39b116c5b6d44 100644 (file)
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,8 @@
 module github.com/prometheus/blackbox_exporter
 
 require (
+       github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
+       github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4 // indirect
        github.com/go-kit/kit v0.8.0
        github.com/kr/pretty v0.1.0 // indirect
        github.com/miekg/dns v1.1.14
diff --git a/go.sum b/go.sum
index ecba72b3ee290e0e9de07a8e17075368ad863d3a..2870e10926715167a76ad8772385a2312f78b2eb 100644 (file)
--- a/go.sum
+++ b/go.sum
@@ -1,7 +1,11 @@
 github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU=
 github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
+github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM=
+github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
 github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZqLG4oE62mJzwPIB8+Tee4RNCL9ulrY=
 github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
+github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4 h1:Hs82Z41s6SdL1CELW+XaDYmOH4hkBN4/N9og/AsOv7E=
+github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
 github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
 github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0=
 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
index 3fd3dd8a58e504345cf4ace39bac5677704241e1..757409da5b14354ef7bbdc27169c817e52bf45ca 100644 (file)
@@ -318,7 +318,11 @@ func ProbeHTTP(ctx context.Context, target string, module config.Module, registr
        // Replace the host field in the URL with the IP we resolved.
        origHost := targetURL.Host
        if targetPort == "" {
-               targetURL.Host = "[" + ip.String() + "]"
+               if strings.Contains(ip.String(), ":") {
+                       targetURL.Host = "[" + ip.String() + "]"
+               } else {
+                       targetURL.Host = ip.String()
+               }
        } else {
                targetURL.Host = net.JoinHostPort(ip.String(), targetPort)
        }
diff --git a/vendor/github.com/alecthomas/template/go.mod b/vendor/github.com/alecthomas/template/go.mod
new file mode 100644 (file)
index 0000000..a70670a
--- /dev/null
@@ -0,0 +1 @@
+module github.com/alecthomas/template
diff --git a/vendor/github.com/alecthomas/units/go.mod b/vendor/github.com/alecthomas/units/go.mod
new file mode 100644 (file)
index 0000000..f572173
--- /dev/null
@@ -0,0 +1 @@
+module github.com/alecthomas/units
index 602c4648e37fabeb7b6be5156dd77835e5e4280a..489a333eb128d37de92310da2831afb9d1cf727a 100644 (file)
@@ -1,7 +1,7 @@
-# github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc
+# github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
 github.com/alecthomas/template
 github.com/alecthomas/template/parse
-# github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf
+# github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4
 github.com/alecthomas/units
 # github.com/beorn7/perks v1.0.0
 github.com/beorn7/perks/quantile