Skip to content

Commit 8b209a2

Browse files
update deps as regular cadence (#3488)
1 parent 2e66a13 commit 8b209a2

File tree

8 files changed

+2052
-727
lines changed

8 files changed

+2052
-727
lines changed

.golangci.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,5 @@ issues:
4242
- should have comment
4343
- use leading k in Go names
4444
- comment on exported const
45-
run:
46-
skip-dirs:
47-
- pkg/clientgen
48-
- pkg/apis/networking.gke.io
45+
exclude-dirs:
4946
- api/operations

CREDITS

Lines changed: 1898 additions & 538 deletions
Large diffs are not rendered by default.

api/admin_client_mock.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ var (
5555
minioAddPolicyMock func(name string, policy *iampolicy.Policy) error
5656
minioSetPolicyMock func(policyName, entityName string, isGroup bool) error
5757

58-
minioStartProfiling func(profiler madmin.ProfilerType) ([]madmin.StartProfilingResult, error)
59-
minioStopProfiling func() (io.ReadCloser, error)
58+
minioStartProfiling func(profiler madmin.ProfilerType, duration time.Duration) (io.ReadCloser, error)
6059

6160
minioServiceRestartMock func(ctx context.Context) error
6261

@@ -248,13 +247,8 @@ func (ac AdminClientMock) setPolicy(_ context.Context, policyName, entityName st
248247
}
249248

250249
// mock function for startProfiling()
251-
func (ac AdminClientMock) startProfiling(_ context.Context, profiler madmin.ProfilerType) ([]madmin.StartProfilingResult, error) {
252-
return minioStartProfiling(profiler)
253-
}
254-
255-
// mock function for stopProfiling()
256-
func (ac AdminClientMock) stopProfiling(_ context.Context) (io.ReadCloser, error) {
257-
return minioStopProfiling()
250+
func (ac AdminClientMock) startProfiling(_ context.Context, profiler madmin.ProfilerType, duration time.Duration) (io.ReadCloser, error) {
251+
return minioStartProfiling(profiler, duration)
258252
}
259253

260254
// mock function of serviceRestart()

api/admin_profiling.go

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,42 +20,30 @@ import (
2020
"context"
2121
"io"
2222
"net/http"
23+
"time"
2324

24-
"github.com/minio/console/models"
2525
"github.com/minio/madmin-go/v3"
2626
"github.com/minio/websocket"
2727
)
2828

29-
var items []*models.StartProfilingItem
30-
3129
type profileOptions struct {
32-
Types string
30+
Types string
31+
Duration time.Duration
3332
}
3433

3534
func getProfileOptionsFromReq(req *http.Request) (*profileOptions, error) {
3635
pOptions := profileOptions{}
3736
pOptions.Types = req.FormValue("types")
37+
pOptions.Duration = 10 * time.Second // TODO: make this configurable
3838
return &pOptions, nil
3939
}
4040

4141
func startProfiling(ctx context.Context, conn WSConn, client MinioAdmin, pOpts *profileOptions) error {
42-
profilingResults, err := client.startProfiling(ctx, madmin.ProfilerType(pOpts.Types))
43-
if err != nil {
44-
return err
45-
}
46-
items = []*models.StartProfilingItem{}
47-
for _, result := range profilingResults {
48-
items = append(items, &models.StartProfilingItem{
49-
Success: result.Success,
50-
Error: result.Error,
51-
NodeName: result.NodeName,
52-
})
53-
}
54-
zippedData, err := client.stopProfiling(ctx)
42+
data, err := client.startProfiling(ctx, madmin.ProfilerType(pOpts.Types), pOpts.Duration)
5543
if err != nil {
5644
return err
5745
}
58-
message, err := io.ReadAll(zippedData)
46+
message, err := io.ReadAll(data)
5947
if err != nil {
6048
return err
6149
}

api/admin_profiling_test.go

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"net/http"
2525
"net/url"
2626
"testing"
27+
"time"
2728

2829
"github.com/minio/madmin-go/v3"
2930
"github.com/stretchr/testify/assert"
@@ -52,22 +53,7 @@ func TestStartProfiling(t *testing.T) {
5253

5354
// Test-1 : startProfiling() Get response from MinIO server with one profiling object without errors
5455
// mock function response from startProfiling()
55-
minioStartProfiling = func(_ madmin.ProfilerType) ([]madmin.StartProfilingResult, error) {
56-
return []madmin.StartProfilingResult{
57-
{
58-
NodeName: "http://127.0.0.1:9000/",
59-
Success: true,
60-
Error: "",
61-
},
62-
{
63-
NodeName: "http://127.0.0.1:9001/",
64-
Success: true,
65-
Error: "",
66-
},
67-
}, nil
68-
}
69-
// mock function response from stopProfiling()
70-
minioStopProfiling = func() (io.ReadCloser, error) {
56+
minioStartProfiling = func(_ madmin.ProfilerType, _ time.Duration) (io.ReadCloser, error) {
7157
return &ClosingBuffer{bytes.NewBufferString("In memory string eaeae")}, nil
7258
}
7359
// mock function response from mockConn.writeMessage()
@@ -82,7 +68,7 @@ func TestStartProfiling(t *testing.T) {
8268

8369
// Test-2 : startProfiling() Correctly handles errors returned by MinIO
8470
// mock function response from startProfiling()
85-
minioStartProfiling = func(_ madmin.ProfilerType) ([]madmin.StartProfilingResult, error) {
71+
minioStartProfiling = func(_ madmin.ProfilerType, _ time.Duration) (io.ReadCloser, error) {
8672
return nil, errors.New("error")
8773
}
8874
err = startProfiling(ctx, mockWSConn, adminClient, testOptions)

api/client-admin.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ type MinioAdmin interface {
6565
delConfigKV(ctx context.Context, kv string) (err error)
6666
serviceRestart(ctx context.Context) error
6767
serverInfo(ctx context.Context) (madmin.InfoMessage, error)
68-
startProfiling(ctx context.Context, profiler madmin.ProfilerType) ([]madmin.StartProfilingResult, error)
69-
stopProfiling(ctx context.Context) (io.ReadCloser, error)
68+
startProfiling(ctx context.Context, profiler madmin.ProfilerType, duration time.Duration) (io.ReadCloser, error)
7069
serviceTrace(ctx context.Context, threshold int64, s3, internal, storage, os, errTrace bool) <-chan madmin.ServiceTraceInfo
7170
getLogs(ctx context.Context, node string, lineCnt int, logKind string) <-chan madmin.LogInfo
7271
AccountInfo(ctx context.Context) (madmin.AccountInfo, error)
@@ -259,7 +258,7 @@ func (ac AdminClient) delConfigKV(ctx context.Context, kv string) (err error) {
259258

260259
// implements madmin.ServiceRestart()
261260
func (ac AdminClient) serviceRestart(ctx context.Context) (err error) {
262-
return ac.Client.ServiceRestart(ctx)
261+
return ac.Client.ServiceRestartV2(ctx)
263262
}
264263

265264
// implements madmin.ServerInfo()
@@ -268,13 +267,8 @@ func (ac AdminClient) serverInfo(ctx context.Context) (madmin.InfoMessage, error
268267
}
269268

270269
// implements madmin.StartProfiling()
271-
func (ac AdminClient) startProfiling(ctx context.Context, profiler madmin.ProfilerType) ([]madmin.StartProfilingResult, error) {
272-
return ac.Client.StartProfiling(ctx, profiler)
273-
}
274-
275-
// implements madmin.DownloadProfilingData()
276-
func (ac AdminClient) stopProfiling(ctx context.Context) (io.ReadCloser, error) {
277-
return ac.Client.DownloadProfilingData(ctx)
270+
func (ac AdminClient) startProfiling(ctx context.Context, profiler madmin.ProfilerType, duration time.Duration) (io.ReadCloser, error) {
271+
return ac.Client.Profile(ctx, profiler, duration)
278272
}
279273

280274
// implements madmin.ServiceTrace()

go.mod

Lines changed: 40 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/blang/semver/v4 v4.0.0
77
github.com/cheggaaa/pb/v3 v3.1.5
88
github.com/dustin/go-humanize v1.0.1 // indirect
9-
github.com/fatih/color v1.17.0
9+
github.com/fatih/color v1.18.0
1010
github.com/go-openapi/errors v0.22.0
1111
github.com/go-openapi/loads v0.22.0
1212
github.com/go-openapi/runtime v0.28.0
@@ -21,28 +21,28 @@ require (
2121
github.com/minio/cli v1.24.2
2222
github.com/minio/highwayhash v1.0.3
2323
github.com/minio/kes v0.23.0
24-
github.com/minio/madmin-go/v3 v3.0.68
25-
github.com/minio/mc v0.0.0-20240815155011-479171e7be9c
26-
github.com/minio/minio-go/v7 v7.0.81-0.20241125171916-a563333c01ef
27-
github.com/minio/pkg/v3 v3.0.22
24+
github.com/minio/madmin-go/v3 v3.0.81
25+
github.com/minio/mc v0.0.0-20241215225040-f4dd5e4a07ff
26+
github.com/minio/minio-go/v7 v7.0.82
2827
github.com/minio/selfupdate v0.6.0
2928
github.com/minio/websocket v1.6.0
3029
github.com/mitchellh/go-homedir v1.1.0
3130
github.com/rs/xid v1.6.0 // indirect
3231
github.com/secure-io/sio-go v0.3.1
33-
github.com/stretchr/testify v1.9.0
32+
github.com/stretchr/testify v1.10.0
3433
github.com/tidwall/gjson v1.17.3 // indirect
3534
github.com/unrolled/secure v1.15.0
36-
golang.org/x/crypto v0.28.0
37-
golang.org/x/net v0.30.0
38-
golang.org/x/oauth2 v0.22.0
39-
35+
golang.org/x/crypto v0.31.0
36+
golang.org/x/net v0.32.0
37+
golang.org/x/oauth2 v0.24.0
4038
// Added to include security fix for
4139
// https://github.com/golang/go/issues/56152
42-
golang.org/x/text v0.19.0 // indirect
40+
golang.org/x/text v0.21.0 // indirect
4341
gopkg.in/yaml.v2 v2.4.0 // indirect
4442
)
4543

44+
require github.com/minio/pkg/v3 v3.0.24
45+
4646
require (
4747
aead.dev/mem v0.2.0 // indirect
4848
aead.dev/minisign v0.3.0 // indirect
@@ -52,13 +52,11 @@ require (
5252
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
5353
github.com/beorn7/perks v1.0.1 // indirect
5454
github.com/cespare/xxhash/v2 v2.3.0 // indirect
55-
github.com/charmbracelet/bubbles v0.18.0 // indirect
56-
github.com/charmbracelet/bubbletea v0.26.6 // indirect
57-
github.com/charmbracelet/lipgloss v0.12.1 // indirect
58-
github.com/charmbracelet/x/ansi v0.1.4 // indirect
59-
github.com/charmbracelet/x/input v0.1.3 // indirect
60-
github.com/charmbracelet/x/term v0.1.1 // indirect
61-
github.com/charmbracelet/x/windows v0.1.2 // indirect
55+
github.com/charmbracelet/bubbles v0.20.0 // indirect
56+
github.com/charmbracelet/bubbletea v1.1.1 // indirect
57+
github.com/charmbracelet/lipgloss v0.13.0 // indirect
58+
github.com/charmbracelet/x/ansi v0.3.2 // indirect
59+
github.com/charmbracelet/x/term v0.2.0 // indirect
6260
github.com/cheggaaa/pb v1.0.29 // indirect
6361
github.com/coreos/go-semver v0.3.1 // indirect
6462
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
@@ -72,7 +70,7 @@ require (
7270
github.com/go-openapi/analysis v0.23.0 // indirect
7371
github.com/go-openapi/jsonpointer v0.21.0 // indirect
7472
github.com/go-openapi/jsonreference v0.21.0 // indirect
75-
github.com/goccy/go-json v0.10.3 // indirect
73+
github.com/goccy/go-json v0.10.4 // indirect
7674
github.com/gogo/protobuf v1.3.2 // indirect
7775
github.com/golang/protobuf v1.5.4 // indirect
7876
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
@@ -82,12 +80,12 @@ require (
8280
github.com/jedib0t/go-pretty/v6 v6.5.9 // indirect
8381
github.com/josharian/intern v1.0.0 // indirect
8482
github.com/juju/ratelimit v1.0.2 // indirect
85-
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
86-
github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect
83+
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
8784
github.com/lestrrat-go/blackmagic v1.0.2 // indirect
8885
github.com/lestrrat-go/httpcc v1.0.1 // indirect
86+
github.com/lestrrat-go/httprc v1.0.6 // indirect
8987
github.com/lestrrat-go/iter v1.0.2 // indirect
90-
github.com/lestrrat-go/jwx v1.2.30 // indirect
88+
github.com/lestrrat-go/jwx/v2 v2.1.3 // indirect
9189
github.com/lestrrat-go/option v1.0.1 // indirect
9290
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
9391
github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683 // indirect
@@ -111,43 +109,42 @@ require (
111109
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
112110
github.com/oklog/ulid v1.3.1 // indirect
113111
github.com/olekukonko/tablewriter v0.0.5 // indirect
114-
github.com/philhofer/fwd v1.1.3-0.20240612014219-fbbf4953d986 // indirect
115-
github.com/pkg/errors v0.9.1 // indirect
112+
github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect
116113
github.com/pkg/xattr v0.4.10 // indirect
117114
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
118115
github.com/posener/complete v1.2.3 // indirect
119116
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
120-
github.com/prometheus/client_golang v1.20.0 // indirect
117+
github.com/prometheus/client_golang v1.20.5 // indirect
121118
github.com/prometheus/client_model v0.6.1 // indirect
122-
github.com/prometheus/common v0.59.1 // indirect
119+
github.com/prometheus/common v0.61.0 // indirect
123120
github.com/prometheus/procfs v0.15.1 // indirect
124-
github.com/prometheus/prom2json v1.4.0 // indirect
125-
github.com/prometheus/prometheus v0.54.1 // indirect
121+
github.com/prometheus/prom2json v1.4.1 // indirect
122+
github.com/prometheus/prometheus v0.300.1 // indirect
126123
github.com/rivo/uniseg v0.4.7 // indirect
127124
github.com/rjeczalik/notify v0.9.3 // indirect
128-
github.com/safchain/ethtool v0.4.1 // indirect
125+
github.com/safchain/ethtool v0.5.9 // indirect
126+
github.com/segmentio/asm v1.2.0 // indirect
129127
github.com/shirou/gopsutil/v3 v3.24.5 // indirect
130128
github.com/shoenig/go-m1cpu v0.1.6 // indirect
131129
github.com/tidwall/match v1.1.1 // indirect
132130
github.com/tidwall/pretty v1.2.1 // indirect
133-
github.com/tinylib/msgp v1.2.1 // indirect
131+
github.com/tinylib/msgp v1.2.5 // indirect
134132
github.com/tklauser/go-sysconf v0.3.14 // indirect
135-
github.com/tklauser/numcpus v0.8.0 // indirect
136-
github.com/vbauerster/mpb/v8 v8.7.5 // indirect
137-
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
133+
github.com/tklauser/numcpus v0.9.0 // indirect
134+
github.com/vbauerster/mpb/v8 v8.8.3 // indirect
138135
github.com/yusufpapurcu/wmi v1.2.4 // indirect
139-
go.etcd.io/etcd/api/v3 v3.5.16 // indirect
140-
go.etcd.io/etcd/client/pkg/v3 v3.5.16 // indirect
141-
go.etcd.io/etcd/client/v3 v3.5.16 // indirect
136+
go.etcd.io/etcd/api/v3 v3.5.17 // indirect
137+
go.etcd.io/etcd/client/pkg/v3 v3.5.17 // indirect
138+
go.etcd.io/etcd/client/v3 v3.5.17 // indirect
142139
go.mongodb.org/mongo-driver v1.16.1 // indirect
143140
go.uber.org/multierr v1.11.0 // indirect
144141
go.uber.org/zap v1.27.0 // indirect
145-
golang.org/x/sync v0.8.0 // indirect
146-
golang.org/x/sys v0.26.0 // indirect
147-
golang.org/x/term v0.25.0 // indirect
148-
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect
149-
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
150-
google.golang.org/grpc v1.66.2 // indirect
151-
google.golang.org/protobuf v1.34.2 // indirect
142+
golang.org/x/sync v0.10.0 // indirect
143+
golang.org/x/sys v0.28.0 // indirect
144+
golang.org/x/term v0.27.0 // indirect
145+
google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 // indirect
146+
google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 // indirect
147+
google.golang.org/grpc v1.69.0 // indirect
148+
google.golang.org/protobuf v1.35.2 // indirect
152149
gopkg.in/yaml.v3 v3.0.1 // indirect
153150
)

0 commit comments

Comments
 (0)