From 141b291c5be893bf7d5bea8212808617e578bf9294b0ffc51942f9ccd8b714e3 Mon Sep 17 00:00:00 2001 From: Lars Vogdt Date: Mon, 29 Jan 2018 12:36:06 +0000 Subject: [PATCH] Accepting request 569480 from security:logging - Update to 2.1.0 OBS-URL: https://build.opensuse.org/request/show/569480 OBS-URL: https://build.opensuse.org/package/show/server:monitoring/golang-github-prometheus-prometheus?expand=0&rev=3 --- 0002-Default-settings.patch | 15 ++-- golang-github-prometheus-prometheus.changes | 5 ++ golang-github-prometheus-prometheus.spec | 2 +- pr-3174.patch | 82 ++++----------------- prometheus-2.0.0.tar.xz | 3 - prometheus-2.1.0.tar.xz | 3 + 6 files changed, 30 insertions(+), 80 deletions(-) delete mode 100644 prometheus-2.0.0.tar.xz create mode 100644 prometheus-2.1.0.tar.xz diff --git a/0002-Default-settings.patch b/0002-Default-settings.patch index 43c7f6f..b23e0e8 100644 --- a/0002-Default-settings.patch +++ b/0002-Default-settings.patch @@ -1,8 +1,7 @@ -Index: prometheus-2.0.0~rc1/cmd/prometheus/main.go -=================================================================== ---- prometheus-2.0.0~rc1.orig/cmd/prometheus/main.go -+++ prometheus-2.0.0~rc1/cmd/prometheus/main.go -@@ -105,7 +105,7 @@ func main() { +diff -ruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-prometheus-2.1.0/cmd/prometheus/main.go ./cmd/prometheus/main.go +--- ../orig-prometheus-2.1.0/cmd/prometheus/main.go 2018-01-19 12:54:28.000000000 +0100 ++++ ./cmd/prometheus/main.go 2018-01-25 12:07:27.050849457 +0100 +@@ -114,7 +114,7 @@ a.HelpFlag.Short('h') a.Flag("config.file", "Prometheus configuration file path."). @@ -11,7 +10,7 @@ Index: prometheus-2.0.0~rc1/cmd/prometheus/main.go a.Flag("web.listen-address", "Address to listen on for UI, API, and telemetry."). Default("0.0.0.0:9090").StringVar(&cfg.web.ListenAddress) -@@ -135,13 +135,13 @@ func main() { +@@ -144,13 +144,13 @@ Default("false").BoolVar(&cfg.web.EnableAdminAPI) a.Flag("web.console.templates", "Path to the console template directory, available at /consoles."). @@ -26,5 +25,5 @@ Index: prometheus-2.0.0~rc1/cmd/prometheus/main.go - Default("data/").StringVar(&cfg.localStoragePath) + Default("/var/lib/prometheus/metrics/").StringVar(&cfg.localStoragePath) - a.Flag("storage.tsdb.min-block-duration", "Minimum duration of a data block before being persisted."). - Default("2h").SetValue(&cfg.tsdb.MinBlockDuration) + a.Flag("storage.tsdb.min-block-duration", "Minimum duration of a data block before being persisted. For use in testing."). + Hidden().Default("2h").SetValue(&cfg.tsdb.MinBlockDuration) diff --git a/golang-github-prometheus-prometheus.changes b/golang-github-prometheus-prometheus.changes index a1ed28f..fa617bd 100644 --- a/golang-github-prometheus-prometheus.changes +++ b/golang-github-prometheus-prometheus.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jan 25 10:11:26 UTC 2018 - kkaempf@suse.com + +- Update to 2.1.0 + ------------------------------------------------------------------- Thu Nov 9 07:30:09 UTC 2017 - tserong@suse.com diff --git a/golang-github-prometheus-prometheus.spec b/golang-github-prometheus-prometheus.spec index 194eb9f..a5fb620 100644 --- a/golang-github-prometheus-prometheus.spec +++ b/golang-github-prometheus-prometheus.spec @@ -18,7 +18,7 @@ %{go_nostrip} Name: golang-github-prometheus-prometheus -Version: 2.0.0 +Version: 2.1.0 Release: 0 License: Apache-2.0 Summary: The Prometheus monitoring system and time series database diff --git a/pr-3174.patch b/pr-3174.patch index 37ba691..6ea70e8 100644 --- a/pr-3174.patch +++ b/pr-3174.patch @@ -1,25 +1,22 @@ -From 49798c915f249922fb1e1ee87be98b1977ee2579 Mon Sep 17 00:00:00 2001 -From: Hylke Visser -Date: Thu, 14 Sep 2017 17:20:22 +0200 -Subject: [PATCH 1/3] Fix REST API gateway loopback address - ---- - web/web.go | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/web/web.go b/web/web.go -index 13d37dfdb..0d4e93221 100644 ---- a/web/web.go -+++ b/web/web.go -@@ -391,7 +391,14 @@ func (h *Handler) Run(ctx context.Context) error { +diff -ruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-prometheus-2.1.0/web/web.go ./web/web.go +--- ../orig-prometheus-2.1.0/web/web.go 2018-01-19 12:54:28.000000000 +0100 ++++ ./web/web.go 2018-01-25 12:11:59.152359023 +0100 +@@ -414,7 +414,21 @@ ) av2.RegisterGRPC(grpcSrv) -- hh, err := av2.HTTPHandler(grpcl.Addr().String()) -+ lAddr := grpcl.Addr().String() -+ host, port, _ := net.SplitHostPort(lAddr) +- hh, err := av2.HTTPHandler(h.options.ListenAddress) ++ lAddr := h.options.ListenAddress ++ host, port, err := net.SplitHostPort(lAddr) ++ if err != nil { ++ return err ++ } + ip := net.ParseIP(host) + if ip.Equal(net.IPv4zero) || ip.Equal(net.IPv6zero) { ++ // The gRPC server is listening on an empty/wildcard address (0.0.0.0 or ::). ++ // We should be able to connect to an empty IP just fine, but as there were ++ // some issues with this in the past (#3004, #3149), we explicitly tell ++ // the REST API gateway to connect to localhost. + lAddr = net.JoinHostPort("localhost", port) + } + @@ -27,54 +24,3 @@ index 13d37dfdb..0d4e93221 100644 if err != nil { return err } - -From 1d3d6614ffe6d04d0b6ae7046bac1709057f4f04 Mon Sep 17 00:00:00 2001 -From: Hylke Visser -Date: Thu, 14 Sep 2017 21:39:29 +0200 -Subject: [PATCH 2/3] Add err check for SplitHostPort of Listener address - ---- - web/web.go | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/web/web.go b/web/web.go -index 0d4e93221..6e5054906 100644 ---- a/web/web.go -+++ b/web/web.go -@@ -392,7 +392,10 @@ func (h *Handler) Run(ctx context.Context) error { - av2.RegisterGRPC(grpcSrv) - - lAddr := grpcl.Addr().String() -- host, port, _ := net.SplitHostPort(lAddr) -+ host, port, err := net.SplitHostPort(lAddr) -+ if err != nil { -+ return err -+ } - ip := net.ParseIP(host) - if ip.Equal(net.IPv4zero) || ip.Equal(net.IPv6zero) { - lAddr = net.JoinHostPort("localhost", port) - -From b2ca81d57eafddc0ff2cbbcf6f00a85d6f81a536 Mon Sep 17 00:00:00 2001 -From: Hylke Visser -Date: Mon, 18 Sep 2017 14:53:45 +0200 -Subject: [PATCH 3/3] Add comment to explain the reason for PR #3174 - ---- - web/web.go | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/web/web.go b/web/web.go -index 6e5054906..c063963a3 100644 ---- a/web/web.go -+++ b/web/web.go -@@ -398,6 +398,10 @@ func (h *Handler) Run(ctx context.Context) error { - } - ip := net.ParseIP(host) - if ip.Equal(net.IPv4zero) || ip.Equal(net.IPv6zero) { -+ // The gRPC server is listening on an empty/wildcard address (0.0.0.0 or ::). -+ // We should be able to connect to an empty IP just fine, but as there were -+ // some issues with this in the past (#3004, #3149), we explicitly tell -+ // the REST API gateway to connect to localhost. - lAddr = net.JoinHostPort("localhost", port) - } - diff --git a/prometheus-2.0.0.tar.xz b/prometheus-2.0.0.tar.xz deleted file mode 100644 index ecda17a..0000000 --- a/prometheus-2.0.0.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6500fe9e195af5a2d5a35cace1e769a2e7816eb9354ccf2c4271c821d3ad4324 -size 3489704 diff --git a/prometheus-2.1.0.tar.xz b/prometheus-2.1.0.tar.xz new file mode 100644 index 0000000..b45843d --- /dev/null +++ b/prometheus-2.1.0.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7bfdcd36e75448465e1cbc5a8ca46721f3035a896b401130f406d2deb84ed3cf +size 3527616