From 4042193c296dfe2c3f97cc3b344944b432f06fb3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 20 Sep 2024 00:48:48 +0000 Subject: [PATCH] Renovate: Update github.com/sapcc/go-bits digest to a80ea73 --- go.mod | 6 ++-- go.sum | 12 +++---- .../gophercloud/gophercloud/v2/CHANGELOG.md | 4 +++ .../gophercloud/v2/provider_client.go | 2 +- .../client_golang/prometheus/histogram.go | 10 +++--- .../sapcc/go-bits/regexpext/regexpext.go | 36 +++++++++++++++++++ vendor/modules.txt | 6 ++-- 7 files changed, 59 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index d92c70a1..cfa2410e 100644 --- a/go.mod +++ b/go.mod @@ -5,14 +5,14 @@ go 1.23 require ( github.com/dlmiddlecote/sqlstats v1.0.2 github.com/go-gorp/gorp/v3 v3.1.0 - github.com/gophercloud/gophercloud/v2 v2.1.0 + github.com/gophercloud/gophercloud/v2 v2.1.1 github.com/gophercloud/utils/v2 v2.0.0-20240912080913-c094a6e5b7da github.com/gorilla/mux v1.8.1 - github.com/prometheus/client_golang v1.20.3 + github.com/prometheus/client_golang v1.20.4 github.com/prometheus/common v0.59.1 github.com/rs/cors v1.11.1 github.com/sapcc/go-api-declarations v1.12.6 - github.com/sapcc/go-bits v0.0.0-20240912081530-0967be9f0a6b + github.com/sapcc/go-bits v0.0.0-20240919081231-a80ea73a2dce go.uber.org/automaxprocs v1.5.3 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index 1ca7d4a6..a6ef840e 100644 --- a/go.sum +++ b/go.sum @@ -59,8 +59,8 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/gophercloud/gophercloud/v2 v2.1.0 h1:91p6c+uMckXyx39nSIYjDirDBnPVFQq0q1njLNPX+NY= -github.com/gophercloud/gophercloud/v2 v2.1.0/go.mod h1:f2hMRC7Kakbv5vM7wSGHrIPZh6JZR60GVHryJlF/K44= +github.com/gophercloud/gophercloud/v2 v2.1.1 h1:KUeVTUoq6um/CijR+hl1JRZ35SXRY62LiYUbgp4qqKw= +github.com/gophercloud/gophercloud/v2 v2.1.1/go.mod h1:f2hMRC7Kakbv5vM7wSGHrIPZh6JZR60GVHryJlF/K44= github.com/gophercloud/utils/v2 v2.0.0-20240912080913-c094a6e5b7da h1:hdJBhN3o3qB5v3J2LIwBEEiI05VglnEyr4VaU4cwNHI= github.com/gophercloud/utils/v2 v2.0.0-20240912080913-c094a6e5b7da/go.mod h1:/4yWChzaUdzjyEElr6rHfasccBJBjlHeszNIj3aLaHg= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= @@ -135,8 +135,8 @@ github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI= +github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -159,8 +159,8 @@ github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/sapcc/go-api-declarations v1.12.6 h1:04sQmS3ipzPc+ENSCWW9A4FgCN7Qa5JIbNUNh7ziQJA= github.com/sapcc/go-api-declarations v1.12.6/go.mod h1:83R3hTANhuRXt/pXDby37IJetw8l7DG41s33Tp9NXxI= -github.com/sapcc/go-bits v0.0.0-20240912081530-0967be9f0a6b h1:t9u9Flob/wvaMfttFxfY4cG5iMx3Cs2I3FGSIqHTJ0U= -github.com/sapcc/go-bits v0.0.0-20240912081530-0967be9f0a6b/go.mod h1:ERkSk9u7zke3ZaV0Ug+SWg7y6KRfeRBx/1CkqovTvgA= +github.com/sapcc/go-bits v0.0.0-20240919081231-a80ea73a2dce h1:Wr/hxpBMp3DP28/k3MchR6WHvyZeIDZQ/BgrmvP9/Mc= +github.com/sapcc/go-bits v0.0.0-20240919081231-a80ea73a2dce/go.mod h1:80FgmJ7WhHF837BcfKnTiic5IxIt0XopzIZwtNJfBSs= github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= diff --git a/vendor/github.com/gophercloud/gophercloud/v2/CHANGELOG.md b/vendor/github.com/gophercloud/gophercloud/v2/CHANGELOG.md index bae5109c..41f9017a 100644 --- a/vendor/github.com/gophercloud/gophercloud/v2/CHANGELOG.md +++ b/vendor/github.com/gophercloud/gophercloud/v2/CHANGELOG.md @@ -1,3 +1,7 @@ +## v2.1.1 (2024-09-18) + +* [GH-3161](https://github.com/gophercloud/gophercloud/pull/3161) [v2] fix: create security group rule with any protocol + ## v2.1.0 (2024-07-24) * [GH-3078](https://github.com/gophercloud/gophercloud/pull/3078) [networking]: add BGP VPNs support diff --git a/vendor/github.com/gophercloud/gophercloud/v2/provider_client.go b/vendor/github.com/gophercloud/gophercloud/v2/provider_client.go index a4a8dce5..e2cd3c2d 100644 --- a/vendor/github.com/gophercloud/gophercloud/v2/provider_client.go +++ b/vendor/github.com/gophercloud/gophercloud/v2/provider_client.go @@ -13,7 +13,7 @@ import ( // DefaultUserAgent is the default User-Agent string set in the request header. const ( - DefaultUserAgent = "gophercloud/v2.1.0" + DefaultUserAgent = "gophercloud/v2.1.1" DefaultMaxBackoffRetries = 60 ) diff --git a/vendor/github.com/prometheus/client_golang/prometheus/histogram.go b/vendor/github.com/prometheus/client_golang/prometheus/histogram.go index 8a4f49a4..519db348 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/histogram.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/histogram.go @@ -844,9 +844,7 @@ func (h *histogram) Write(out *dto.Metric) error { }} } - // If exemplars are not configured, the cap will be 0. - // So append is not needed in this case. - if cap(h.nativeExemplars.exemplars) > 0 { + if h.nativeExemplars.isEnabled() { h.nativeExemplars.Lock() his.Exemplars = append(his.Exemplars, h.nativeExemplars.exemplars...) h.nativeExemplars.Unlock() @@ -1665,6 +1663,10 @@ type nativeExemplars struct { exemplars []*dto.Exemplar } +func (n *nativeExemplars) isEnabled() bool { + return n.ttl != -1 +} + func makeNativeExemplars(ttl time.Duration, maxCount int) nativeExemplars { if ttl == 0 { ttl = 5 * time.Minute @@ -1686,7 +1688,7 @@ func makeNativeExemplars(ttl time.Duration, maxCount int) nativeExemplars { } func (n *nativeExemplars) addExemplar(e *dto.Exemplar) { - if n.ttl == -1 { + if !n.isEnabled() { return } diff --git a/vendor/github.com/sapcc/go-bits/regexpext/regexpext.go b/vendor/github.com/sapcc/go-bits/regexpext/regexpext.go index f3f8f083..c8d25d78 100644 --- a/vendor/github.com/sapcc/go-bits/regexpext/regexpext.go +++ b/vendor/github.com/sapcc/go-bits/regexpext/regexpext.go @@ -65,10 +65,18 @@ import ( "encoding/json" "fmt" "regexp" + "strings" lru "github.com/hashicorp/golang-lru/v2" ) +// isLiteral returns true if none of the chars in `x` are regexp syntax. +// For example, isLiteral("foo_bar12") is true, but isLiteral("foo*bar") is false. +func isLiteral(x string) bool { + // the character list comes from `var specialBytes` in src/regexp/regexp.go of std + return !strings.ContainsAny(x, "\\.+*?()|[]{}^$") +} + // PlainRegexp is a regex string that implements the Marshaler and Unmarshaler // interfaces for encoding/json and gopkg.in/yaml.v2, respectively. This type // also works with gopkg.in/yaml.v3: Even though the Unmarshaler interface has @@ -98,6 +106,11 @@ func (r PlainRegexp) Regexp() (*regexp.Regexp, error) { // Shorthand for `r.Regexp()` followed by `rx.MatchString()`. If regex parsing // returns an error, this function returns false. func (r PlainRegexp) MatchString(in string) bool { + // optimization: match literals without regex compilation to reduce pressure on `cache` + if isLiteral(string(r)) { + return strings.Contains(in, string(r)) + } + rx, err := r.Regexp() if err != nil { return false @@ -108,6 +121,15 @@ func (r PlainRegexp) MatchString(in string) bool { // Shorthand for `r.Regexp()` followed by `rx.FindStringSubmatch()`. If regex parsing // returns an error, this function returns nil. func (r PlainRegexp) FindStringSubmatch(in string) []string { + // optimization: match literals without regex compilation to reduce pressure on `cache` + if isLiteral(string(r)) { + if strings.Contains(in, string(r)) { + return []string{string(r)} + } else { + return nil + } + } + rx, err := r.Regexp() if err != nil { return nil @@ -143,6 +165,11 @@ func (r BoundedRegexp) Regexp() (*regexp.Regexp, error) { // Shorthand for `r.Regexp()` followed by `rx.MatchString()`. If regex parsing // returns an error, this function returns false. func (r BoundedRegexp) MatchString(in string) bool { + // optimization: match literals without regex compilation to reduce pressure on `cache` + if isLiteral(string(r)) { + return in == string(r) + } + rx, err := r.Regexp() if err != nil { return false @@ -153,6 +180,15 @@ func (r BoundedRegexp) MatchString(in string) bool { // Shorthand for `r.Regexp()` followed by `rx.FindStringSubmatch()`. If regex parsing // returns an error, this function returns nil. func (r BoundedRegexp) FindStringSubmatch(in string) []string { + // optimization: match literals without regex compilation to reduce pressure on `cache` + if isLiteral(string(r)) { + if in == string(r) { + return []string{string(r)} + } else { + return nil + } + } + rx, err := r.Regexp() if err != nil { return nil diff --git a/vendor/modules.txt b/vendor/modules.txt index d606cd0e..7bd5ae1c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -25,7 +25,7 @@ github.com/golang-migrate/migrate/v4/database/postgres github.com/golang-migrate/migrate/v4/internal/url github.com/golang-migrate/migrate/v4/source github.com/golang-migrate/migrate/v4/source/go_bindata -# github.com/gophercloud/gophercloud/v2 v2.1.0 +# github.com/gophercloud/gophercloud/v2 v2.1.1 ## explicit; go 1.22 github.com/gophercloud/gophercloud/v2 github.com/gophercloud/gophercloud/v2/openstack @@ -97,7 +97,7 @@ github.com/modern-go/reflect2 # github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 ## explicit github.com/munnerz/goautoneg -# github.com/prometheus/client_golang v1.20.3 +# github.com/prometheus/client_golang v1.20.4 ## explicit; go 1.20 github.com/prometheus/client_golang/api github.com/prometheus/client_golang/api/prometheus/v1 @@ -130,7 +130,7 @@ github.com/rs/cors/internal github.com/sapcc/go-api-declarations/bininfo github.com/sapcc/go-api-declarations/cadf github.com/sapcc/go-api-declarations/castellum -# github.com/sapcc/go-bits v0.0.0-20240912081530-0967be9f0a6b +# github.com/sapcc/go-bits v0.0.0-20240919081231-a80ea73a2dce ## explicit; go 1.23 github.com/sapcc/go-bits/assert github.com/sapcc/go-bits/audittools