diff --git a/0001-Do-not-force-the-pure-Go-name-resolver.patch b/0001-Do-not-force-the-pure-Go-name-resolver.patch index d3eca36..1fd00b5 100644 --- a/0001-Do-not-force-the-pure-Go-name-resolver.patch +++ b/0001-Do-not-force-the-pure-Go-name-resolver.patch @@ -1,4 +1,4 @@ -From 7953e106d8afa5ba660396c1c59bcc674ef3a404 Mon Sep 17 00:00:00 2001 +From dca10001054ba4f61a8be3f4ef67223509a26683 Mon Sep 17 00:00:00 2001 From: Jan Fajerski Date: Fri, 8 Feb 2019 09:17:06 +0100 Subject: [PATCH 1/3] Do not force the pure Go name resolver @@ -15,18 +15,18 @@ Signed-off-by: Jan Fajerski 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.promu.yml b/.promu.yml -index caaa63a55..f75af963d 100644 +index f52a646de..782f973a8 100644 --- a/.promu.yml +++ b/.promu.yml @@ -10,7 +10,7 @@ build: path: ./cmd/prometheus - name: promtool path: ./cmd/promtool -- flags: -mod=vendor -a -tags netgo,builtinassets +- flags: -a -tags netgo,builtinassets + flags: -mod=vendor -a -tags builtinassets ldflags: | -X github.com/prometheus/common/version.Version={{.Version}} -X github.com/prometheus/common/version.Revision={{.Revision}} -- -2.29.2 +2.26.2 diff --git a/0002-Default-settings.patch b/0002-Default-settings.patch index aa399a7..1808347 100644 --- a/0002-Default-settings.patch +++ b/0002-Default-settings.patch @@ -1,4 +1,4 @@ -From 129223e15588c384c39b279213c81ba24e2f7ac9 Mon Sep 17 00:00:00 2001 +From 7860b67a0a684d2d51087e323b780410031d83af Mon Sep 17 00:00:00 2001 From: Jan Fajerski Date: Fri, 8 Feb 2019 09:28:12 +0100 Subject: [PATCH 2/3] Default settings @@ -9,10 +9,10 @@ Signed-off-by: Jan Fajerski 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/prometheus/main.go b/cmd/prometheus/main.go -index fa6b6fa88..ac9f9dcfa 100644 +index 37a7f3535..ae43ded89 100644 --- a/cmd/prometheus/main.go +++ b/cmd/prometheus/main.go -@@ -147,7 +147,7 @@ func main() { +@@ -187,7 +187,7 @@ func main() { a.HelpFlag.Short('h') a.Flag("config.file", "Prometheus configuration file path."). @@ -21,7 +21,7 @@ index fa6b6fa88..ac9f9dcfa 100644 a.Flag("web.listen-address", "Address to listen on for UI, API, and telemetry."). Default("0.0.0.0:9090").StringVar(&cfg.web.ListenAddress) -@@ -177,10 +177,10 @@ func main() { +@@ -219,10 +219,10 @@ func main() { Default("false").BoolVar(&cfg.web.EnableAdminAPI) a.Flag("web.console.templates", "Path to the console template directory, available at /consoles."). @@ -34,7 +34,7 @@ index fa6b6fa88..ac9f9dcfa 100644 a.Flag("web.page-title", "Document title of Prometheus instance."). Default("Prometheus Time Series Collection and Processing Server").StringVar(&cfg.web.PageTitle) -@@ -189,7 +189,7 @@ func main() { +@@ -231,7 +231,7 @@ func main() { Default(".*").StringVar(&cfg.corsRegexString) a.Flag("storage.tsdb.path", "Base path for metrics storage."). @@ -44,5 +44,5 @@ index fa6b6fa88..ac9f9dcfa 100644 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) -- -2.29.2 +2.26.2 diff --git a/0003-Add-Uyuni-service-discovery.patch b/0003-Add-Uyuni-service-discovery.patch index 7d1ac8e..7bf8800 100644 --- a/0003-Add-Uyuni-service-discovery.patch +++ b/0003-Add-Uyuni-service-discovery.patch @@ -1,58 +1,35 @@ -From e55a27d2102a77ce3f01f3f36060843bb2b46fd2 Mon Sep 17 00:00:00 2001 +From c19bd11c323a073a2c96f2e500de66320e3a627a Mon Sep 17 00:00:00 2001 From: Joao Cavalheiro Date: Mon, 27 Jul 2020 17:42:33 +0200 Subject: [PATCH 3/3] Add Uyuni service discovery --- - discovery/install/install.go | 1 + - discovery/uyuni/uyuni.go | 405 ++++++++++++++++ - discovery/uyuni/uyuni_test.go | 46 ++ - go.mod | 1 + - go.sum | 2 + - vendor/github.com/kolo/xmlrpc/LICENSE | 19 + - vendor/github.com/kolo/xmlrpc/README.md | 90 ++++ - vendor/github.com/kolo/xmlrpc/client.go | 161 +++++++ - vendor/github.com/kolo/xmlrpc/decoder.go | 473 +++++++++++++++++++ - vendor/github.com/kolo/xmlrpc/encoder.go | 181 +++++++ - vendor/github.com/kolo/xmlrpc/go.mod | 5 + - vendor/github.com/kolo/xmlrpc/go.sum | 3 + - vendor/github.com/kolo/xmlrpc/is_zero.go | 44 ++ - vendor/github.com/kolo/xmlrpc/request.go | 57 +++ - vendor/github.com/kolo/xmlrpc/response.go | 42 ++ - vendor/github.com/kolo/xmlrpc/test_server.rb | 25 + - vendor/modules.txt | 3 + - 17 files changed, 1558 insertions(+) + discovery/install/install.go | 1 + + discovery/uyuni/uyuni.go | 411 ++++++++++++++++++++++++++++++++++ + discovery/uyuni/uyuni_test.go | 46 ++++ + go.mod | 1 + + go.sum | 2 + + 5 files changed, 461 insertions(+) create mode 100644 discovery/uyuni/uyuni.go create mode 100644 discovery/uyuni/uyuni_test.go - create mode 100644 vendor/github.com/kolo/xmlrpc/LICENSE - create mode 100644 vendor/github.com/kolo/xmlrpc/README.md - create mode 100644 vendor/github.com/kolo/xmlrpc/client.go - create mode 100644 vendor/github.com/kolo/xmlrpc/decoder.go - create mode 100644 vendor/github.com/kolo/xmlrpc/encoder.go - create mode 100644 vendor/github.com/kolo/xmlrpc/go.mod - create mode 100644 vendor/github.com/kolo/xmlrpc/go.sum - create mode 100644 vendor/github.com/kolo/xmlrpc/is_zero.go - create mode 100644 vendor/github.com/kolo/xmlrpc/request.go - create mode 100644 vendor/github.com/kolo/xmlrpc/response.go - create mode 100644 vendor/github.com/kolo/xmlrpc/test_server.rb diff --git a/discovery/install/install.go b/discovery/install/install.go -index d9394f270..7af209cac 100644 +index 075a302e4..7cc2395bb 100644 --- a/discovery/install/install.go +++ b/discovery/install/install.go -@@ -30,5 +30,6 @@ import ( - _ "github.com/prometheus/prometheus/discovery/marathon" // register marathon +@@ -31,5 +31,6 @@ import ( _ "github.com/prometheus/prometheus/discovery/openstack" // register openstack + _ "github.com/prometheus/prometheus/discovery/scaleway" // register scaleway _ "github.com/prometheus/prometheus/discovery/triton" // register triton + _ "github.com/prometheus/prometheus/discovery/uyuni" // register uyuni _ "github.com/prometheus/prometheus/discovery/zookeeper" // register zookeeper ) diff --git a/discovery/uyuni/uyuni.go b/discovery/uyuni/uyuni.go new file mode 100644 -index 000000000..2336d2746 +index 000000000..8163a3bf0 --- /dev/null +++ b/discovery/uyuni/uyuni.go -@@ -0,0 +1,405 @@ +@@ -0,0 +1,411 @@ +// Copyright 2019 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. @@ -127,6 +104,10 @@ index 000000000..2336d2746 + IP string `xmlrpc:"ip"` +} + ++type tlsConfig struct { ++ Enabled bool `xmlrpc:"enabled"` ++} ++ +type exporterConfig struct { + Address string `xmlrpc:"address"` + Args string `xmlrpc:"args"` @@ -134,11 +115,10 @@ index 000000000..2336d2746 +} + +type proxiedExporterConfig struct { -+ ProxyIsEnabled bool `xmlrpc:"proxy_enabled"` -+ ProxyPort float32 `xmlrpc:"proxy_port"` -+ NodeExporter exporterConfig `xmlrpc:"node_exporter"` -+ ApacheExporter exporterConfig `xmlrpc:"apache_exporter"` -+ PostgresExporter exporterConfig `xmlrpc:"postgres_exporter"` ++ ProxyIsEnabled bool `xmlrpc:"proxy_enabled"` ++ ProxyPort float32 `xmlrpc:"proxy_port"` ++ TLSConfig tlsConfig `xmlrpc:"tls"` ++ ExporterConfigs map[string]exporterConfig `xmlrpc:"exporters"` +} + +// Discovery periodically performs Uyuni API requests. It implements the Discoverer interface. @@ -291,7 +271,7 @@ index 000000000..2336d2746 + +func initializeExporterTargets( + targets *[]model.LabelSet, -+ module string, config exporterConfig, ++ exporterName string, config exporterConfig, + proxyPort string, + errors *[]error, +) { @@ -311,11 +291,11 @@ index 000000000..2336d2746 + } + + labels := model.LabelSet{} -+ labels["exporter"] = model.LabelValue(module + "_exporter") ++ labels["exporter"] = model.LabelValue(exporterName) + // for now set only port number here + labels[model.AddressLabel] = model.LabelValue(port) + if len(proxyPort) > 0 { -+ labels[model.ParamLabelPrefix+"module"] = model.LabelValue(module) ++ labels[model.ParamLabelPrefix+"module"] = model.LabelValue(exporterName) + } + *targets = append(*targets, labels) +} @@ -339,9 +319,9 @@ index 000000000..2336d2746 + } else { + hostname = networkInfo.Hostname + } -+ initializeExporterTargets(&labelSets, "node", combinedFormulaData.NodeExporter, proxyPortNumber, &errors) -+ initializeExporterTargets(&labelSets, "apache", combinedFormulaData.ApacheExporter, proxyPortNumber, &errors) -+ initializeExporterTargets(&labelSets, "postgres", combinedFormulaData.PostgresExporter, proxyPortNumber, &errors) ++ for exporterName, formulaValues := range combinedFormulaData.ExporterConfigs { ++ initializeExporterTargets(&labelSets, exporterName, formulaValues, proxyPortNumber, &errors) ++ } + managedGroupNames := getSystemGroupNames(systemGroupsIDs) + for _, labels := range labelSets { + // add hostname to the address label @@ -352,6 +332,9 @@ index 000000000..2336d2746 + if combinedFormulaData.ProxyIsEnabled { + labels[model.MetricsPathLabel] = "/proxy" + } ++ if combinedFormulaData.TLSConfig.Enabled { ++ labels[model.SchemeLabel] = "https" ++ } + _ = level.Debug(d.logger).Log("msg", "Configured target", "Labels", fmt.Sprintf("%+v", labels)) + } + for _, err := range errors { @@ -511,1210 +494,30 @@ index 000000000..c5fa8cc9e + } +} diff --git a/go.mod b/go.mod -index 38982f449..9a261a5c9 100644 +index a4b7ff2a6..d347d7682 100644 --- a/go.mod +++ b/go.mod -@@ -38,6 +38,7 @@ require ( - github.com/hetznercloud/hcloud-go v1.22.0 - github.com/influxdata/influxdb v1.8.3 +@@ -34,6 +34,7 @@ require ( + github.com/hetznercloud/hcloud-go v1.24.0 + github.com/influxdata/influxdb v1.8.4 github.com/json-iterator/go v1.1.10 + github.com/kolo/xmlrpc v0.0.0-20201022064351-38db28db192b - github.com/miekg/dns v1.1.31 - github.com/mitchellh/mapstructure v1.2.2 // indirect + github.com/miekg/dns v1.1.41 + github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 // indirect github.com/morikuni/aec v1.0.0 // indirect diff --git a/go.sum b/go.sum -index 9a16a1838..be06c9453 100644 +index d424276c8..e62734c2a 100644 --- a/go.sum +++ b/go.sum -@@ -524,6 +524,8 @@ github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0 +@@ -552,6 +552,8 @@ github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0 github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= +github.com/kolo/xmlrpc v0.0.0-20201022064351-38db28db192b h1:iNjcivnc6lhbvJA3LD622NPrUponluJrBWPIwGG/3Bg= +github.com/kolo/xmlrpc v0.0.0-20201022064351-38db28db192b/go.mod h1:pcaDhQK0/NJZEvtCO0qQPPropqV0sJOJ6YW7X+9kRwM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= - github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -diff --git a/vendor/github.com/kolo/xmlrpc/LICENSE b/vendor/github.com/kolo/xmlrpc/LICENSE -new file mode 100644 -index 000000000..8103dd139 ---- /dev/null -+++ b/vendor/github.com/kolo/xmlrpc/LICENSE -@@ -0,0 +1,19 @@ -+Copyright (C) 2012 Dmitry Maksimov -+ -+Permission is hereby granted, free of charge, to any person obtaining a copy -+of this software and associated documentation files (the "Software"), to deal -+in the Software without restriction, including without limitation the rights -+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -+copies of the Software, and to permit persons to whom the Software is -+furnished to do so, subject to the following conditions: -+ -+The above copyright notice and this permission notice shall be included in -+all copies or substantial portions of the Software. -+ -+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -+THE SOFTWARE. -diff --git a/vendor/github.com/kolo/xmlrpc/README.md b/vendor/github.com/kolo/xmlrpc/README.md -new file mode 100644 -index 000000000..fecfcd839 ---- /dev/null -+++ b/vendor/github.com/kolo/xmlrpc/README.md -@@ -0,0 +1,90 @@ -+[![GoDoc](https://godoc.org/github.com/kolo/xmlrpc?status.svg)](https://godoc.org/github.com/kolo/xmlrpc) -+ -+## Overview -+ -+xmlrpc is an implementation of client side part of XMLRPC protocol in Go language. -+ -+## Status -+ -+This project is in minimal maintenance mode with no further development. Bug fixes -+are accepted, but it might take some time until they will be merged. -+ -+## Installation -+ -+To install xmlrpc package run `go get github.com/kolo/xmlrpc`. To use -+it in application add `"github.com/kolo/xmlrpc"` string to `import` -+statement. -+ -+## Usage -+ -+ client, _ := xmlrpc.NewClient("https://bugzilla.mozilla.org/xmlrpc.cgi", nil) -+ result := struct{ -+ Version string `xmlrpc:"version"` -+ }{} -+ client.Call("Bugzilla.version", nil, &result) -+ fmt.Printf("Version: %s\n", result.Version) // Version: 4.2.7+ -+ -+Second argument of NewClient function is an object that implements -+[http.RoundTripper](http://golang.org/pkg/net/http/#RoundTripper) -+interface, it can be used to get more control over connection options. -+By default it initialized by http.DefaultTransport object. -+ -+### Arguments encoding -+ -+xmlrpc package supports encoding of native Go data types to method -+arguments. -+ -+Data types encoding rules: -+ -+* int, int8, int16, int32, int64 encoded to int; -+* float32, float64 encoded to double; -+* bool encoded to boolean; -+* string encoded to string; -+* time.Time encoded to datetime.iso8601; -+* xmlrpc.Base64 encoded to base64; -+* slice encoded to array; -+ -+Structs encoded to struct by following rules: -+ -+* all public field become struct members; -+* field name become member name; -+* if field has xmlrpc tag, its value become member name. -+* for fields tagged with `",omitempty"`, empty values are omitted; -+ -+Server method can accept few arguments, to handle this case there is -+special approach to handle slice of empty interfaces (`[]interface{}`). -+Each value of such slice encoded as separate argument. -+ -+### Result decoding -+ -+Result of remote function is decoded to native Go data type. -+ -+Data types decoding rules: -+ -+* int, i4 decoded to int, int8, int16, int32, int64; -+* double decoded to float32, float64; -+* boolean decoded to bool; -+* string decoded to string; -+* array decoded to slice; -+* structs decoded following the rules described in previous section; -+* datetime.iso8601 decoded as time.Time data type; -+* base64 decoded to string. -+ -+## Implementation details -+ -+xmlrpc package contains clientCodec type, that implements [rpc.ClientCodec](http://golang.org/pkg/net/rpc/#ClientCodec) -+interface of [net/rpc](http://golang.org/pkg/net/rpc) package. -+ -+xmlrpc package works over HTTP protocol, but some internal functions -+and data type were made public to make it easier to create another -+implementation of xmlrpc that works over another protocol. To encode -+request body there is EncodeMethodCall function. To decode server -+response Response data type can be used. -+ -+## Contribution -+ -+See [project status](#status). -+ -+## Authors -+ -+Dmitry Maksimov (dmtmax@gmail.com) -diff --git a/vendor/github.com/kolo/xmlrpc/client.go b/vendor/github.com/kolo/xmlrpc/client.go -new file mode 100644 -index 000000000..643dc1c10 ---- /dev/null -+++ b/vendor/github.com/kolo/xmlrpc/client.go -@@ -0,0 +1,161 @@ -+package xmlrpc -+ -+import ( -+ "errors" -+ "fmt" -+ "io/ioutil" -+ "net/http" -+ "net/http/cookiejar" -+ "net/rpc" -+ "net/url" -+ "sync" -+) -+ -+type Client struct { -+ *rpc.Client -+} -+ -+// clientCodec is rpc.ClientCodec interface implementation. -+type clientCodec struct { -+ // url presents url of xmlrpc service -+ url *url.URL -+ -+ // httpClient works with HTTP protocol -+ httpClient *http.Client -+ -+ // cookies stores cookies received on last request -+ cookies http.CookieJar -+ -+ // responses presents map of active requests. It is required to return request id, that -+ // rpc.Client can mark them as done. -+ responses map[uint64]*http.Response -+ mutex sync.Mutex -+ -+ response Response -+ -+ // ready presents channel, that is used to link request and it`s response. -+ ready chan uint64 -+ -+ // close notifies codec is closed. -+ close chan uint64 -+} -+ -+func (codec *clientCodec) WriteRequest(request *rpc.Request, args interface{}) (err error) { -+ httpRequest, err := NewRequest(codec.url.String(), request.ServiceMethod, args) -+ -+ if err != nil { -+ return err -+ } -+ -+ if codec.cookies != nil { -+ for _, cookie := range codec.cookies.Cookies(codec.url) { -+ httpRequest.AddCookie(cookie) -+ } -+ } -+ -+ var httpResponse *http.Response -+ httpResponse, err = codec.httpClient.Do(httpRequest) -+ -+ if err != nil { -+ return err -+ } -+ -+ if codec.cookies != nil { -+ codec.cookies.SetCookies(codec.url, httpResponse.Cookies()) -+ } -+ -+ codec.mutex.Lock() -+ codec.responses[request.Seq] = httpResponse -+ codec.mutex.Unlock() -+ -+ codec.ready <- request.Seq -+ -+ return nil -+} -+ -+func (codec *clientCodec) ReadResponseHeader(response *rpc.Response) (err error) { -+ var seq uint64 -+ select { -+ case seq = <-codec.ready: -+ case <-codec.close: -+ return errors.New("codec is closed") -+ } -+ response.Seq = seq -+ -+ codec.mutex.Lock() -+ httpResponse := codec.responses[seq] -+ delete(codec.responses, seq) -+ codec.mutex.Unlock() -+ -+ defer httpResponse.Body.Close() -+ -+ if httpResponse.StatusCode < 200 || httpResponse.StatusCode >= 300 { -+ response.Error = fmt.Sprintf("request error: bad status code - %d", httpResponse.StatusCode) -+ return nil -+ } -+ -+ body, err := ioutil.ReadAll(httpResponse.Body) -+ if err != nil { -+ response.Error = err.Error() -+ return nil -+ } -+ -+ resp := Response(body) -+ if err := resp.Err(); err != nil { -+ response.Error = err.Error() -+ return nil -+ } -+ -+ codec.response = resp -+ -+ return nil -+} -+ -+func (codec *clientCodec) ReadResponseBody(v interface{}) (err error) { -+ if v == nil { -+ return nil -+ } -+ return codec.response.Unmarshal(v) -+} -+ -+func (codec *clientCodec) Close() error { -+ if transport, ok := codec.httpClient.Transport.(*http.Transport); ok { -+ transport.CloseIdleConnections() -+ } -+ -+ close(codec.close) -+ -+ return nil -+} -+ -+// NewClient returns instance of rpc.Client object, that is used to send request to xmlrpc service. -+func NewClient(requrl string, transport http.RoundTripper) (*Client, error) { -+ if transport == nil { -+ transport = http.DefaultTransport -+ } -+ -+ httpClient := &http.Client{Transport: transport} -+ -+ jar, err := cookiejar.New(nil) -+ -+ if err != nil { -+ return nil, err -+ } -+ -+ u, err := url.Parse(requrl) -+ -+ if err != nil { -+ return nil, err -+ } -+ -+ codec := clientCodec{ -+ url: u, -+ httpClient: httpClient, -+ close: make(chan uint64), -+ ready: make(chan uint64), -+ responses: make(map[uint64]*http.Response), -+ cookies: jar, -+ } -+ -+ return &Client{rpc.NewClientWithCodec(&codec)}, nil -+} -diff --git a/vendor/github.com/kolo/xmlrpc/decoder.go b/vendor/github.com/kolo/xmlrpc/decoder.go -new file mode 100644 -index 000000000..d4dcb19ad ---- /dev/null -+++ b/vendor/github.com/kolo/xmlrpc/decoder.go -@@ -0,0 +1,473 @@ -+package xmlrpc -+ -+import ( -+ "bytes" -+ "encoding/xml" -+ "errors" -+ "fmt" -+ "io" -+ "reflect" -+ "strconv" -+ "strings" -+ "time" -+) -+ -+const ( -+ iso8601 = "20060102T15:04:05" -+ iso8601Z = "20060102T15:04:05Z07:00" -+ iso8601Hyphen = "2006-01-02T15:04:05" -+ iso8601HyphenZ = "2006-01-02T15:04:05Z07:00" -+) -+ -+var ( -+ // CharsetReader is a function to generate reader which converts a non UTF-8 -+ // charset into UTF-8. -+ CharsetReader func(string, io.Reader) (io.Reader, error) -+ -+ timeLayouts = []string{iso8601, iso8601Z, iso8601Hyphen, iso8601HyphenZ} -+ invalidXmlError = errors.New("invalid xml") -+) -+ -+type TypeMismatchError string -+ -+func (e TypeMismatchError) Error() string { return string(e) } -+ -+type decoder struct { -+ *xml.Decoder -+} -+ -+func unmarshal(data []byte, v interface{}) (err error) { -+ dec := &decoder{xml.NewDecoder(bytes.NewBuffer(data))} -+ -+ if CharsetReader != nil { -+ dec.CharsetReader = CharsetReader -+ } -+ -+ var tok xml.Token -+ for { -+ if tok, err = dec.Token(); err != nil { -+ return err -+ } -+ -+ if t, ok := tok.(xml.StartElement); ok { -+ if t.Name.Local == "value" { -+ val := reflect.ValueOf(v) -+ if val.Kind() != reflect.Ptr { -+ return errors.New("non-pointer value passed to unmarshal") -+ } -+ if err = dec.decodeValue(val.Elem()); err != nil { -+ return err -+ } -+ -+ break -+ } -+ } -+ } -+ -+ // read until end of document -+ err = dec.Skip() -+ if err != nil && err != io.EOF { -+ return err -+ } -+ -+ return nil -+} -+ -+func (dec *decoder) decodeValue(val reflect.Value) error { -+ var tok xml.Token -+ var err error -+ -+ if val.Kind() == reflect.Ptr { -+ if val.IsNil() { -+ val.Set(reflect.New(val.Type().Elem())) -+ } -+ val = val.Elem() -+ } -+ -+ var typeName string -+ for { -+ if tok, err = dec.Token(); err != nil { -+ return err -+ } -+ -+ if t, ok := tok.(xml.EndElement); ok { -+ if t.Name.Local == "value" { -+ return nil -+ } else { -+ return invalidXmlError -+ } -+ } -+ -+ if t, ok := tok.(xml.StartElement); ok { -+ typeName = t.Name.Local -+ break -+ } -+ -+ // Treat value data without type identifier as string -+ if t, ok := tok.(xml.CharData); ok { -+ if value := strings.TrimSpace(string(t)); value != "" { -+ if err = checkType(val, reflect.String); err != nil { -+ return err -+ } -+ -+ val.SetString(value) -+ return nil -+ } -+ } -+ } -+ -+ switch typeName { -+ case "struct": -+ ismap := false -+ pmap := val -+ valType := val.Type() -+ -+ if err = checkType(val, reflect.Struct); err != nil { -+ if checkType(val, reflect.Map) == nil { -+ if valType.Key().Kind() != reflect.String { -+ return fmt.Errorf("only maps with string key type can be unmarshalled") -+ } -+ ismap = true -+ } else if checkType(val, reflect.Interface) == nil && val.IsNil() { -+ var dummy map[string]interface{} -+ valType = reflect.TypeOf(dummy) -+ pmap = reflect.New(valType).Elem() -+ val.Set(pmap) -+ ismap = true -+ } else { -+ return err -+ } -+ } -+ -+ var fields map[string]reflect.Value -+ -+ if !ismap { -+ fields = make(map[string]reflect.Value) -+ -+ for i := 0; i < valType.NumField(); i++ { -+ field := valType.Field(i) -+ fieldVal := val.FieldByName(field.Name) -+ -+ if fieldVal.CanSet() { -+ if fn := field.Tag.Get("xmlrpc"); fn != "" { -+ fields[fn] = fieldVal -+ } else { -+ fields[field.Name] = fieldVal -+ } -+ } -+ } -+ } else { -+ // Create initial empty map -+ pmap.Set(reflect.MakeMap(valType)) -+ } -+ -+ // Process struct members. -+ StructLoop: -+ for { -+ if tok, err = dec.Token(); err != nil { -+ return err -+ } -+ switch t := tok.(type) { -+ case xml.StartElement: -+ if t.Name.Local != "member" { -+ return invalidXmlError -+ } -+ -+ tagName, fieldName, err := dec.readTag() -+ if err != nil { -+ return err -+ } -+ if tagName != "name" { -+ return invalidXmlError -+ } -+ -+ var fv reflect.Value -+ ok := true -+ -+ if !ismap { -+ fv, ok = fields[string(fieldName)] -+ } else { -+ fv = reflect.New(valType.Elem()) -+ } -+ -+ if ok { -+ for { -+ if tok, err = dec.Token(); err != nil { -+ return err -+ } -+ if t, ok := tok.(xml.StartElement); ok && t.Name.Local == "value" { -+ if err = dec.decodeValue(fv); err != nil { -+ return err -+ } -+ -+ // -+ if err = dec.Skip(); err != nil { -+ return err -+ } -+ -+ break -+ } -+ } -+ } -+ -+ // -+ if err = dec.Skip(); err != nil { -+ return err -+ } -+ -+ if ismap { -+ pmap.SetMapIndex(reflect.ValueOf(string(fieldName)), reflect.Indirect(fv)) -+ val.Set(pmap) -+ } -+ case xml.EndElement: -+ break StructLoop -+ } -+ } -+ case "array": -+ slice := val -+ if checkType(val, reflect.Interface) == nil && val.IsNil() { -+ slice = reflect.ValueOf([]interface{}{}) -+ } else if err = checkType(val, reflect.Slice); err != nil { -+ return err -+ } -+ -+ ArrayLoop: -+ for { -+ if tok, err = dec.Token(); err != nil { -+ return err -+ } -+ -+ switch t := tok.(type) { -+ case xml.StartElement: -+ var index int -+ if t.Name.Local != "data" { -+ return invalidXmlError -+ } -+ DataLoop: -+ for { -+ if tok, err = dec.Token(); err != nil { -+ return err -+ } -+ -+ switch tt := tok.(type) { -+ case xml.StartElement: -+ if tt.Name.Local != "value" { -+ return invalidXmlError -+ } -+ -+ if index < slice.Len() { -+ v := slice.Index(index) -+ if v.Kind() == reflect.Interface { -+ v = v.Elem() -+ } -+ if v.Kind() != reflect.Ptr { -+ return errors.New("error: cannot write to non-pointer array element") -+ } -+ if err = dec.decodeValue(v); err != nil { -+ return err -+ } -+ } else { -+ v := reflect.New(slice.Type().Elem()) -+ if err = dec.decodeValue(v); err != nil { -+ return err -+ } -+ slice = reflect.Append(slice, v.Elem()) -+ } -+ -+ // -+ if err = dec.Skip(); err != nil { -+ return err -+ } -+ index++ -+ case xml.EndElement: -+ val.Set(slice) -+ break DataLoop -+ } -+ } -+ case xml.EndElement: -+ break ArrayLoop -+ } -+ } -+ default: -+ if tok, err = dec.Token(); err != nil { -+ return err -+ } -+ -+ var data []byte -+ -+ switch t := tok.(type) { -+ case xml.EndElement: -+ return nil -+ case xml.CharData: -+ data = []byte(t.Copy()) -+ default: -+ return invalidXmlError -+ } -+ -+ switch typeName { -+ case "int", "i4", "i8": -+ if checkType(val, reflect.Interface) == nil && val.IsNil() { -+ i, err := strconv.ParseInt(string(data), 10, 64) -+ if err != nil { -+ return err -+ } -+ -+ pi := reflect.New(reflect.TypeOf(i)).Elem() -+ pi.SetInt(i) -+ val.Set(pi) -+ } else if err = checkType(val, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64); err != nil { -+ return err -+ } else { -+ i, err := strconv.ParseInt(string(data), 10, val.Type().Bits()) -+ if err != nil { -+ return err -+ } -+ -+ val.SetInt(i) -+ } -+ case "string", "base64": -+ str := string(data) -+ if checkType(val, reflect.Interface) == nil && val.IsNil() { -+ pstr := reflect.New(reflect.TypeOf(str)).Elem() -+ pstr.SetString(str) -+ val.Set(pstr) -+ } else if err = checkType(val, reflect.String); err != nil { -+ return err -+ } else { -+ val.SetString(str) -+ } -+ case "dateTime.iso8601": -+ var t time.Time -+ var err error -+ -+ for _, layout := range timeLayouts { -+ t, err = time.Parse(layout, string(data)) -+ if err == nil { -+ break -+ } -+ } -+ if err != nil { -+ return err -+ } -+ -+ if checkType(val, reflect.Interface) == nil && val.IsNil() { -+ ptime := reflect.New(reflect.TypeOf(t)).Elem() -+ ptime.Set(reflect.ValueOf(t)) -+ val.Set(ptime) -+ } else if _, ok := val.Interface().(time.Time); !ok { -+ return TypeMismatchError(fmt.Sprintf("error: type mismatch error - can't decode %v to time", val.Kind())) -+ } else { -+ val.Set(reflect.ValueOf(t)) -+ } -+ case "boolean": -+ v, err := strconv.ParseBool(string(data)) -+ if err != nil { -+ return err -+ } -+ -+ if checkType(val, reflect.Interface) == nil && val.IsNil() { -+ pv := reflect.New(reflect.TypeOf(v)).Elem() -+ pv.SetBool(v) -+ val.Set(pv) -+ } else if err = checkType(val, reflect.Bool); err != nil { -+ return err -+ } else { -+ val.SetBool(v) -+ } -+ case "double": -+ if checkType(val, reflect.Interface) == nil && val.IsNil() { -+ i, err := strconv.ParseFloat(string(data), 64) -+ if err != nil { -+ return err -+ } -+ -+ pdouble := reflect.New(reflect.TypeOf(i)).Elem() -+ pdouble.SetFloat(i) -+ val.Set(pdouble) -+ } else if err = checkType(val, reflect.Float32, reflect.Float64); err != nil { -+ return err -+ } else { -+ i, err := strconv.ParseFloat(string(data), val.Type().Bits()) -+ if err != nil { -+ return err -+ } -+ -+ val.SetFloat(i) -+ } -+ default: -+ return errors.New("unsupported type") -+ } -+ -+ // -+ if err = dec.Skip(); err != nil { -+ return err -+ } -+ } -+ -+ return nil -+} -+ -+func (dec *decoder) readTag() (string, []byte, error) { -+ var tok xml.Token -+ var err error -+ -+ var name string -+ for { -+ if tok, err = dec.Token(); err != nil { -+ return "", nil, err -+ } -+ -+ if t, ok := tok.(xml.StartElement); ok { -+ name = t.Name.Local -+ break -+ } -+ } -+ -+ value, err := dec.readCharData() -+ if err != nil { -+ return "", nil, err -+ } -+ -+ return name, value, dec.Skip() -+} -+ -+func (dec *decoder) readCharData() ([]byte, error) { -+ var tok xml.Token -+ var err error -+ -+ if tok, err = dec.Token(); err != nil { -+ return nil, err -+ } -+ -+ if t, ok := tok.(xml.CharData); ok { -+ return []byte(t.Copy()), nil -+ } else { -+ return nil, invalidXmlError -+ } -+} -+ -+func checkType(val reflect.Value, kinds ...reflect.Kind) error { -+ if len(kinds) == 0 { -+ return nil -+ } -+ -+ if val.Kind() == reflect.Ptr { -+ val = val.Elem() -+ } -+ -+ match := false -+ -+ for _, kind := range kinds { -+ if val.Kind() == kind { -+ match = true -+ break -+ } -+ } -+ -+ if !match { -+ return TypeMismatchError(fmt.Sprintf("error: type mismatch - can't unmarshal %v to %v", -+ val.Kind(), kinds[0])) -+ } -+ -+ return nil -+} -diff --git a/vendor/github.com/kolo/xmlrpc/encoder.go b/vendor/github.com/kolo/xmlrpc/encoder.go -new file mode 100644 -index 000000000..7ab271aa5 ---- /dev/null -+++ b/vendor/github.com/kolo/xmlrpc/encoder.go -@@ -0,0 +1,181 @@ -+package xmlrpc -+ -+import ( -+ "bytes" -+ "encoding/xml" -+ "fmt" -+ "reflect" -+ "sort" -+ "strconv" -+ "strings" -+ "time" -+) -+ -+// Base64 represents value in base64 encoding -+type Base64 string -+ -+type encodeFunc func(reflect.Value) ([]byte, error) -+ -+func marshal(v interface{}) ([]byte, error) { -+ if v == nil { -+ return []byte{}, nil -+ } -+ -+ val := reflect.ValueOf(v) -+ return encodeValue(val) -+} -+ -+func encodeValue(val reflect.Value) ([]byte, error) { -+ var b []byte -+ var err error -+ -+ if val.Kind() == reflect.Ptr || val.Kind() == reflect.Interface { -+ if val.IsNil() { -+ return []byte(""), nil -+ } -+ -+ val = val.Elem() -+ } -+ -+ switch val.Kind() { -+ case reflect.Struct: -+ switch val.Interface().(type) { -+ case time.Time: -+ t := val.Interface().(time.Time) -+ b = []byte(fmt.Sprintf("%s", t.Format(iso8601))) -+ default: -+ b, err = encodeStruct(val) -+ } -+ case reflect.Map: -+ b, err = encodeMap(val) -+ case reflect.Slice: -+ b, err = encodeSlice(val) -+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: -+ b = []byte(fmt.Sprintf("%s", strconv.FormatInt(val.Int(), 10))) -+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: -+ b = []byte(fmt.Sprintf("%s", strconv.FormatUint(val.Uint(), 10))) -+ case reflect.Float32, reflect.Float64: -+ b = []byte(fmt.Sprintf("%s", -+ strconv.FormatFloat(val.Float(), 'f', -1, val.Type().Bits()))) -+ case reflect.Bool: -+ if val.Bool() { -+ b = []byte("1") -+ } else { -+ b = []byte("0") -+ } -+ case reflect.String: -+ var buf bytes.Buffer -+ -+ xml.Escape(&buf, []byte(val.String())) -+ -+ if _, ok := val.Interface().(Base64); ok { -+ b = []byte(fmt.Sprintf("%s", buf.String())) -+ } else { -+ b = []byte(fmt.Sprintf("%s", buf.String())) -+ } -+ default: -+ return nil, fmt.Errorf("xmlrpc encode error: unsupported type") -+ } -+ -+ if err != nil { -+ return nil, err -+ } -+ -+ return []byte(fmt.Sprintf("%s", string(b))), nil -+} -+ -+func encodeStruct(structVal reflect.Value) ([]byte, error) { -+ var b bytes.Buffer -+ -+ b.WriteString("") -+ -+ structType := structVal.Type() -+ for i := 0; i < structType.NumField(); i++ { -+ fieldVal := structVal.Field(i) -+ fieldType := structType.Field(i) -+ -+ name := fieldType.Tag.Get("xmlrpc") -+ // if the tag has the omitempty property, skip it -+ if strings.HasSuffix(name, ",omitempty") && isZero(fieldVal) { -+ continue -+ } -+ name = strings.TrimSuffix(name, ",omitempty") -+ if name == "" { -+ name = fieldType.Name -+ } -+ -+ p, err := encodeValue(fieldVal) -+ if err != nil { -+ return nil, err -+ } -+ -+ b.WriteString("") -+ b.WriteString(fmt.Sprintf("%s", name)) -+ b.Write(p) -+ b.WriteString("") -+ } -+ -+ b.WriteString("") -+ -+ return b.Bytes(), nil -+} -+ -+var sortMapKeys bool -+ -+func encodeMap(val reflect.Value) ([]byte, error) { -+ var t = val.Type() -+ -+ if t.Key().Kind() != reflect.String { -+ return nil, fmt.Errorf("xmlrpc encode error: only maps with string keys are supported") -+ } -+ -+ var b bytes.Buffer -+ -+ b.WriteString("") -+ -+ keys := val.MapKeys() -+ -+ if sortMapKeys { -+ sort.Slice(keys, func(i, j int) bool { return keys[i].String() < keys[j].String() }) -+ } -+ -+ for i := 0; i < val.Len(); i++ { -+ key := keys[i] -+ kval := val.MapIndex(key) -+ -+ b.WriteString("") -+ b.WriteString(fmt.Sprintf("%s", key.String())) -+ -+ p, err := encodeValue(kval) -+ -+ if err != nil { -+ return nil, err -+ } -+ -+ b.Write(p) -+ b.WriteString("") -+ } -+ -+ b.WriteString("") -+ -+ return b.Bytes(), nil -+} -+ -+func encodeSlice(val reflect.Value) ([]byte, error) { -+ var b bytes.Buffer -+ -+ b.WriteString("") -+ -+ for i := 0; i < val.Len(); i++ { -+ p, err := encodeValue(val.Index(i)) -+ if err != nil { -+ return nil, err -+ } -+ -+ b.Write(p) -+ } -+ -+ b.WriteString("") -+ -+ return b.Bytes(), nil -+} -diff --git a/vendor/github.com/kolo/xmlrpc/go.mod b/vendor/github.com/kolo/xmlrpc/go.mod -new file mode 100644 -index 000000000..42e7acd80 ---- /dev/null -+++ b/vendor/github.com/kolo/xmlrpc/go.mod -@@ -0,0 +1,5 @@ -+module github.com/kolo/xmlrpc -+ -+go 1.14 -+ -+require golang.org/x/text v0.3.3 -diff --git a/vendor/github.com/kolo/xmlrpc/go.sum b/vendor/github.com/kolo/xmlrpc/go.sum -new file mode 100644 -index 000000000..fd5b10f79 ---- /dev/null -+++ b/vendor/github.com/kolo/xmlrpc/go.sum -@@ -0,0 +1,3 @@ -+golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= -+golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -diff --git a/vendor/github.com/kolo/xmlrpc/is_zero.go b/vendor/github.com/kolo/xmlrpc/is_zero.go -new file mode 100644 -index 000000000..65276d04a ---- /dev/null -+++ b/vendor/github.com/kolo/xmlrpc/is_zero.go -@@ -0,0 +1,44 @@ -+package xmlrpc -+ -+import ( -+ "math" -+ . "reflect" -+) -+ -+func isZero(v Value) bool { -+ switch v.Kind() { -+ case Bool: -+ return !v.Bool() -+ case Int, Int8, Int16, Int32, Int64: -+ return v.Int() == 0 -+ case Uint, Uint8, Uint16, Uint32, Uint64, Uintptr: -+ return v.Uint() == 0 -+ case Float32, Float64: -+ return math.Float64bits(v.Float()) == 0 -+ case Complex64, Complex128: -+ c := v.Complex() -+ return math.Float64bits(real(c)) == 0 && math.Float64bits(imag(c)) == 0 -+ case Array: -+ for i := 0; i < v.Len(); i++ { -+ if !isZero(v.Index(i)) { -+ return false -+ } -+ } -+ return true -+ case Chan, Func, Interface, Map, Ptr, Slice, UnsafePointer: -+ return v.IsNil() -+ case String: -+ return v.Len() == 0 -+ case Struct: -+ for i := 0; i < v.NumField(); i++ { -+ if !isZero(v.Field(i)) { -+ return false -+ } -+ } -+ return true -+ default: -+ // This should never happens, but will act as a safeguard for -+ // later, as a default value doesn't makes sense here. -+ panic(&ValueError{"reflect.Value.IsZero", v.Kind()}) -+ } -+} -diff --git a/vendor/github.com/kolo/xmlrpc/request.go b/vendor/github.com/kolo/xmlrpc/request.go -new file mode 100644 -index 000000000..acb8251b2 ---- /dev/null -+++ b/vendor/github.com/kolo/xmlrpc/request.go -@@ -0,0 +1,57 @@ -+package xmlrpc -+ -+import ( -+ "bytes" -+ "fmt" -+ "net/http" -+) -+ -+func NewRequest(url string, method string, args interface{}) (*http.Request, error) { -+ var t []interface{} -+ var ok bool -+ if t, ok = args.([]interface{}); !ok { -+ if args != nil { -+ t = []interface{}{args} -+ } -+ } -+ -+ body, err := EncodeMethodCall(method, t...) -+ if err != nil { -+ return nil, err -+ } -+ -+ request, err := http.NewRequest("POST", url, bytes.NewReader(body)) -+ if err != nil { -+ return nil, err -+ } -+ -+ request.Header.Set("Content-Type", "text/xml") -+ request.Header.Set("Content-Length", fmt.Sprintf("%d", len(body))) -+ -+ return request, nil -+} -+ -+func EncodeMethodCall(method string, args ...interface{}) ([]byte, error) { -+ var b bytes.Buffer -+ b.WriteString(``) -+ b.WriteString(fmt.Sprintf("%s", method)) -+ -+ if args != nil { -+ b.WriteString("") -+ -+ for _, arg := range args { -+ p, err := marshal(arg) -+ if err != nil { -+ return nil, err -+ } -+ -+ b.WriteString(fmt.Sprintf("%s", string(p))) -+ } -+ -+ b.WriteString("") -+ } -+ -+ b.WriteString("") -+ -+ return b.Bytes(), nil -+} -diff --git a/vendor/github.com/kolo/xmlrpc/response.go b/vendor/github.com/kolo/xmlrpc/response.go -new file mode 100644 -index 000000000..18e6d366c ---- /dev/null -+++ b/vendor/github.com/kolo/xmlrpc/response.go -@@ -0,0 +1,42 @@ -+package xmlrpc -+ -+import ( -+ "fmt" -+ "regexp" -+) -+ -+var ( -+ faultRx = regexp.MustCompile(`(\s|\S)+`) -+) -+ -+// FaultError is returned from the server when an invalid call is made -+type FaultError struct { -+ Code int `xmlrpc:"faultCode"` -+ String string `xmlrpc:"faultString"` -+} -+ -+// Error implements the error interface -+func (e FaultError) Error() string { -+ return fmt.Sprintf("Fault(%d): %s", e.Code, e.String) -+} -+ -+type Response []byte -+ -+func (r Response) Err() error { -+ if !faultRx.Match(r) { -+ return nil -+ } -+ var fault FaultError -+ if err := unmarshal(r, &fault); err != nil { -+ return err -+ } -+ return fault -+} -+ -+func (r Response) Unmarshal(v interface{}) error { -+ if err := unmarshal(r, v); err != nil { -+ return err -+ } -+ -+ return nil -+} -diff --git a/vendor/github.com/kolo/xmlrpc/test_server.rb b/vendor/github.com/kolo/xmlrpc/test_server.rb -new file mode 100644 -index 000000000..1ccfc9ac4 ---- /dev/null -+++ b/vendor/github.com/kolo/xmlrpc/test_server.rb -@@ -0,0 +1,25 @@ -+# encoding: utf-8 -+ -+require "xmlrpc/server" -+ -+class Service -+ def time -+ Time.now -+ end -+ -+ def upcase(s) -+ s.upcase -+ end -+ -+ def sum(x, y) -+ x + y -+ end -+ -+ def error -+ raise XMLRPC::FaultException.new(500, "Server error") -+ end -+end -+ -+server = XMLRPC::Server.new 5001, 'localhost' -+server.add_handler "service", Service.new -+server.serve -diff --git a/vendor/modules.txt b/vendor/modules.txt -index a2365b4c8..7f30086c3 100644 ---- a/vendor/modules.txt -+++ b/vendor/modules.txt -@@ -312,6 +312,9 @@ github.com/jpillora/backoff - github.com/json-iterator/go - # github.com/julienschmidt/httprouter v1.3.0 - github.com/julienschmidt/httprouter -+# github.com/kolo/xmlrpc v0.0.0-20201022064351-38db28db192b -+## explicit -+github.com/kolo/xmlrpc - # github.com/konsorten/go-windows-terminal-sequences v1.0.3 - github.com/konsorten/go-windows-terminal-sequences - # github.com/mailru/easyjson v0.7.1 + github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= -- 2.26.2 diff --git a/_service b/_service index c4928d8..64bfabc 100644 --- a/_service +++ b/_service @@ -4,12 +4,12 @@ git .git @PARENT_TAG@ - v2.22.1 + v2.26.0 v(.*) - prometheus-*.tar - xz + *.tar + gz prometheus diff --git a/golang-github-prometheus-prometheus.changes b/golang-github-prometheus-prometheus.changes index 4643ff7..972516d 100644 --- a/golang-github-prometheus-prometheus.changes +++ b/golang-github-prometheus-prometheus.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Tue May 4 14:35:58 UTC 2021 - Witek Bedyk + +- Upgrade to upstream version 2.26.0 +- Add vendor and web_assets tarballs +- Uyuni: Read formula data from exporters map +- Uyuni: Add support for TLS targets + + Changed: + * 0003-Add-Uyuni-service-discovery.patch + ------------------------------------------------------------------- Tue Mar 9 13:28:50 UTC 2021 - Witek Bedyk diff --git a/golang-github-prometheus-prometheus.spec b/golang-github-prometheus-prometheus.spec index a9aa19d..fe19b38 100644 --- a/golang-github-prometheus-prometheus.spec +++ b/golang-github-prometheus-prometheus.spec @@ -27,16 +27,19 @@ %endif Name: golang-github-prometheus-prometheus -Version: 2.22.1 +Version: 2.26.0 Release: 0 Summary: The Prometheus monitoring system and time series database License: Apache-2.0 Group: System/Monitoring URL: https://prometheus.io/ -Source: prometheus-%{version}.tar.xz -Source1: prometheus.service -Source2: prometheus.yml -Source3: prometheus.sysconfig +Source: prometheus-%{version}.tar.gz +# generated after applying Patch3 and running `go mod vendor` +# also includes web assets generated with `make assets` +Source1: vendor.tar.gz +Source2: prometheus.service +Source3: prometheus.yml +Source4: prometheus.sysconfig Patch1: 0001-Do-not-force-the-pure-Go-name-resolver.patch # Lifted from Debian's prometheus package Patch2: 0002-Default-settings.patch @@ -48,7 +51,6 @@ BuildRequires: fdupes BuildRequires: glibc-devel-static BuildRequires: golang-github-prometheus-promu BuildRequires: golang-packaging -BuildRequires: xz BuildRequires: golang(API) >= 1.14 BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires(pre): user(prometheus) @@ -70,7 +72,7 @@ Prometheus's main features are: - multiple modes of graphing and dashboarding support %prep -%autosetup -p1 -n prometheus-%{version} +%autosetup -a1 -p1 -n prometheus-%{version} %build %goprep github.com/prometheus/prometheus @@ -79,9 +81,9 @@ GOPATH=%{_builddir}/go promu build -v %install install -D -m0755 %{_builddir}/prometheus-%{version}/prometheus %{buildroot}/%{_bindir}/prometheus install -D -m0755 %{_builddir}/prometheus-%{version}/promtool %{buildroot}/%{_bindir}/promtool -install -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/prometheus.service +install -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/prometheus.service -install -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/prometheus/prometheus.yml +install -D -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/prometheus/prometheus.yml install -d -m 0755 %{buildroot}%{_sbindir} ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcprometheus @@ -90,7 +92,7 @@ install -m 0755 -d %{buildroot}%{_datarootdir}/prometheus cp -fr console_libraries/ consoles/ %{buildroot}%{_datarootdir}/prometheus install -m 0755 -d %{buildroot}%{_fillupdir} -install -m 0644 %{SOURCE3} %{buildroot}%{_fillupdir}/sysconfig.prometheus +install -m 0644 %{SOURCE4} %{buildroot}%{_fillupdir}/sysconfig.prometheus install -Dd -m 0750 %{buildroot}%{_localstatedir}/lib/prometheus install -Dd -m 0750 %{buildroot}%{_localstatedir}/lib/prometheus/data diff --git a/prometheus-2.22.1.tar.xz b/prometheus-2.22.1.tar.xz deleted file mode 100644 index 523e33c..0000000 --- a/prometheus-2.22.1.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:56fa74d4989d05e3585a784f44961aca9eaac9cbfc0cc07dbaaf797194bcb6e2 -size 12706560 diff --git a/prometheus-2.26.0.tar.gz b/prometheus-2.26.0.tar.gz new file mode 100644 index 0000000..e30a709 --- /dev/null +++ b/prometheus-2.26.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d66c6169273f5dabccbc482a13103b635db73135c009f929c8351277aabc75e +size 62006663 diff --git a/vendor.tar.gz b/vendor.tar.gz new file mode 100644 index 0000000..4e1ac1b --- /dev/null +++ b/vendor.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:82c0d517e9ac1393040a2d5ddfdc5cf65100199137c5870c9309f5fbdaf39905 +size 18078140