Skip to content

Commit 1c62faf

Browse files
authored
sec: bump some golang mod for security (#625)
* sec: bump some golang mod for security * revert binary
1 parent 88c5483 commit 1c62faf

File tree

5 files changed

+224
-494
lines changed

5 files changed

+224
-494
lines changed

cmd/main.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030
"github.com/hashicorp/go-version"
3131
"github.com/pkg/errors"
3232
"github.com/prometheus/common/model"
33-
"github.com/prometheus/prometheus/pkg/rulefmt"
33+
"github.com/prometheus/prometheus/model/rulefmt"
3434
"github.com/spf13/cobra"
3535
"github.com/tidwall/gjson"
3636
"github.com/tidwall/sjson"
@@ -428,29 +428,29 @@ func replaceAlertExpr(content []byte) ([]byte, error) {
428428
newG := rulefmt.RuleGroup{
429429
Interval: group.Interval,
430430
Name: group.Name,
431-
Rules: make([]rulefmt.Rule, 0, len(group.Rules)),
431+
Rules: make([]rulefmt.RuleNode, 0, len(group.Rules)),
432432
}
433433

434434
stream.OfSlice(group.Rules).Map(func(t streamtypes.T) streamtypes.R {
435-
rule := t.(rulefmt.Rule)
435+
rule := t.(rulefmt.RuleNode)
436436

437437
if time.Duration(rule.For) <= (time.Second * 60) {
438438
rule.For = forConfig
439439
}
440440

441-
newExpr, ok := needToReplaceExpr[strings.ToUpper(rule.Alert)]
441+
newExpr, ok := needToReplaceExpr[strings.ToUpper(rule.Alert.Value)]
442442
if !ok {
443443
return rule
444444
}
445445

446-
rule.Expr = newExpr
446+
rule.Expr.SetString(newExpr)
447447
if _, ok := rule.Labels["expr"]; ok {
448448
rule.Labels["expr"] = newExpr
449449
}
450450

451451
return rule
452452
}).ForEach(func(t streamtypes.T) {
453-
rule := t.(rulefmt.Rule)
453+
rule := t.(rulefmt.RuleNode)
454454
newG.Rules = append(newG.Rules, rule)
455455
})
456456

go.mod

+42-40
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/pingcap/monitoring
22

3-
go 1.23
3+
go 1.23.2
44

55
require (
66
github.com/fsnotify/fsnotify v1.7.0
@@ -10,95 +10,97 @@ require (
1010
github.com/google/go-querystring v1.1.0
1111
github.com/hashicorp/go-version v1.7.0
1212
github.com/pkg/errors v0.9.1
13-
github.com/prometheus/common v0.4.1
14-
github.com/prometheus/prometheus v0.0.0-20190710134608-e5b22494857d
13+
github.com/prometheus/common v0.55.0
14+
github.com/prometheus/prometheus v0.54.1
1515
github.com/rakyll/statik v0.1.7
1616
github.com/spf13/cobra v1.8.1
1717
github.com/tidwall/gjson v1.18.0
1818
github.com/tidwall/sjson v1.2.5
1919
github.com/youthlin/stream v0.0.3
2020
golang.org/x/oauth2 v0.23.0
2121
gopkg.in/yaml.v2 v2.4.0
22-
k8s.io/client-go v12.0.0+incompatible
22+
k8s.io/client-go v0.29.3
2323
)
2424

2525
require (
2626
dario.cat/mergo v1.0.0 // indirect
2727
github.com/Microsoft/go-winio v0.6.1 // indirect
2828
github.com/ProtonMail/go-crypto v1.0.0 // indirect
29-
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc // indirect
30-
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf // indirect
31-
github.com/beorn7/perks v1.0.0 // indirect
29+
github.com/beorn7/perks v1.0.1 // indirect
3230
github.com/bytedance/sonic v1.11.6 // indirect
3331
github.com/bytedance/sonic/loader v0.1.1 // indirect
34-
github.com/cespare/xxhash v1.1.0 // indirect
32+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
3533
github.com/cloudflare/circl v1.3.7 // indirect
3634
github.com/cloudwego/base64x v0.1.4 // indirect
3735
github.com/cloudwego/iasm v0.2.0 // indirect
3836
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
39-
github.com/davecgh/go-spew v1.1.1 // indirect
37+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
38+
github.com/dennwc/varint v1.0.0 // indirect
39+
github.com/edsrzf/mmap-go v1.1.0 // indirect
4040
github.com/emirpasic/gods v1.18.1 // indirect
41+
github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb // indirect
4142
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
4243
github.com/gin-contrib/sse v0.1.0 // indirect
4344
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
4445
github.com/go-git/go-billy/v5 v5.5.0 // indirect
45-
github.com/go-kit/kit v0.9.0 // indirect
46-
github.com/go-logfmt/logfmt v0.4.0 // indirect
46+
github.com/go-kit/log v0.2.1 // indirect
47+
github.com/go-logfmt/logfmt v0.6.0 // indirect
48+
github.com/go-logr/logr v1.4.2 // indirect
49+
github.com/go-logr/stdr v1.2.2 // indirect
4750
github.com/go-playground/locales v0.14.1 // indirect
4851
github.com/go-playground/universal-translator v0.18.1 // indirect
4952
github.com/go-playground/validator/v10 v10.20.0 // indirect
5053
github.com/goccy/go-json v0.10.2 // indirect
51-
github.com/gogo/protobuf v1.2.1 // indirect
54+
github.com/gogo/protobuf v1.3.2 // indirect
5255
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
53-
github.com/golang/protobuf v1.5.0 // indirect
54-
github.com/golang/snappy v0.0.1 // indirect
55-
github.com/google/gofuzz v1.0.0 // indirect
56+
github.com/google/gofuzz v1.2.0 // indirect
57+
github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc // indirect
5658
github.com/inconshreveable/mousetrap v1.1.0 // indirect
5759
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
5860
github.com/json-iterator/go v1.1.12 // indirect
5961
github.com/kevinburke/ssh_config v1.2.0 // indirect
6062
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
61-
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 // indirect
6263
github.com/leodido/go-urn v1.4.0 // indirect
6364
github.com/mattn/go-isatty v0.0.20 // indirect
64-
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
6565
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
6666
github.com/modern-go/reflect2 v1.0.2 // indirect
67-
github.com/oklog/ulid v1.3.1 // indirect
68-
github.com/opentracing/opentracing-go v1.1.0 // indirect
67+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
6968
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
7069
github.com/pjbgf/sha1cd v0.3.0 // indirect
71-
github.com/prometheus/client_golang v1.0.0 // indirect
72-
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 // indirect
73-
github.com/prometheus/procfs v0.0.2 // indirect
74-
github.com/prometheus/tsdb v0.9.1 // indirect
70+
github.com/prometheus/client_golang v1.19.1 // indirect
71+
github.com/prometheus/client_model v0.6.1 // indirect
72+
github.com/prometheus/procfs v0.15.1 // indirect
73+
github.com/rogpeppe/go-internal v1.12.0 // indirect
7574
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
76-
github.com/sirupsen/logrus v1.9.0 // indirect
7775
github.com/skeema/knownhosts v1.2.2 // indirect
7876
github.com/spf13/pflag v1.0.5 // indirect
7977
github.com/tidwall/match v1.1.1 // indirect
8078
github.com/tidwall/pretty v1.2.0 // indirect
8179
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
8280
github.com/ugorji/go/codec v1.2.12 // indirect
8381
github.com/xanzy/ssh-agent v0.3.3 // indirect
82+
go.opentelemetry.io/otel v1.28.0 // indirect
83+
go.opentelemetry.io/otel/metric v1.28.0 // indirect
84+
go.opentelemetry.io/otel/trace v1.28.0 // indirect
85+
go.uber.org/atomic v1.11.0 // indirect
8486
golang.org/x/arch v0.8.0 // indirect
85-
golang.org/x/crypto v0.23.0 // indirect
86-
golang.org/x/mod v0.12.0 // indirect
87-
golang.org/x/net v0.25.0 // indirect
88-
golang.org/x/sync v0.3.0 // indirect
89-
golang.org/x/sys v0.20.0 // indirect
90-
golang.org/x/term v0.20.0 // indirect
91-
golang.org/x/text v0.15.0 // indirect
92-
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2 // indirect
93-
golang.org/x/tools v0.13.0 // indirect
94-
google.golang.org/protobuf v1.34.1 // indirect
95-
gopkg.in/alecthomas/kingpin.v2 v2.2.6 // indirect
87+
golang.org/x/crypto v0.25.0 // indirect
88+
golang.org/x/mod v0.19.0 // indirect
89+
golang.org/x/net v0.27.0 // indirect
90+
golang.org/x/sync v0.7.0 // indirect
91+
golang.org/x/sys v0.22.0 // indirect
92+
golang.org/x/term v0.22.0 // indirect
93+
golang.org/x/text v0.16.0 // indirect
94+
golang.org/x/time v0.5.0 // indirect
95+
golang.org/x/tools v0.23.0 // indirect
96+
google.golang.org/protobuf v1.34.2 // indirect
9697
gopkg.in/inf.v0 v0.9.1 // indirect
9798
gopkg.in/warnings.v0 v0.1.2 // indirect
9899
gopkg.in/yaml.v3 v3.0.1 // indirect
99-
k8s.io/api v0.0.0-20190720062849-3043179095b6 // indirect
100-
k8s.io/apimachinery v0.0.0-20190719140911-bfcf53abc9f8 // indirect
101-
k8s.io/klog v0.3.1 // indirect
102-
k8s.io/utils v0.0.0-20190607212802-c55fbcfc754a // indirect
103-
sigs.k8s.io/yaml v1.1.0 // indirect
100+
k8s.io/apimachinery v0.29.3 // indirect
101+
k8s.io/klog/v2 v2.130.1 // indirect
102+
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
103+
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
104+
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
105+
sigs.k8s.io/yaml v1.3.0 // indirect
104106
)

0 commit comments

Comments
 (0)