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

5 files changed

Lines changed: 224 additions & 494 deletions

File tree

cmd/main.go

Lines changed: 6 additions & 6 deletions
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

Lines changed: 42 additions & 40 deletions
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)