Skip to content

Commit d667701

Browse files
committed
remove unnecessary dependencies
Signed-off-by: Mengxin Liu <[email protected]>
1 parent 88a74a0 commit d667701

File tree

7 files changed

+14
-39
lines changed

7 files changed

+14
-39
lines changed

go.mod

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ require (
2121
github.com/go-logr/stdr v1.2.2
2222
github.com/go-logr/zapr v1.3.0
2323
github.com/google/gopacket v1.1.19
24-
github.com/google/uuid v1.6.0
2524
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.7.7
2625
github.com/k8snetworkplumbingwg/sriovnet v1.2.0
2726
github.com/kubeovn/felix v0.0.0-20240506083207-ed396be1b6cf
@@ -41,7 +40,6 @@ require (
4140
github.com/prometheus-community/pro-bing v0.7.0
4241
github.com/prometheus/client_golang v1.23.2
4342
github.com/puzpuzpuz/xsync/v4 v4.2.0
44-
github.com/rs/zerolog v1.34.0
4543
github.com/scylladb/go-set v1.0.2
4644
github.com/sirupsen/logrus v1.9.3
4745
github.com/spf13/pflag v1.0.10
@@ -157,6 +155,7 @@ require (
157155
github.com/google/gnostic-models v0.7.0 // indirect
158156
github.com/google/go-cmp v0.7.0 // indirect
159157
github.com/google/pprof v0.0.0-20250830080959-101d87ff5bc3 // indirect
158+
github.com/google/uuid v1.6.0 // indirect
160159
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
161160
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
162161
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
@@ -178,8 +177,6 @@ require (
178177
github.com/libopenstorage/openstorage v1.0.0 // indirect
179178
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
180179
github.com/mailru/easyjson v0.9.0 // indirect
181-
github.com/mattn/go-colorable v0.1.14 // indirect
182-
github.com/mattn/go-isatty v0.0.20 // indirect
183180
github.com/mdlayher/ethernet v0.0.0-20220221185849-529eae5b6118 // indirect
184181
github.com/mdlayher/socket v0.5.1 // indirect
185182
github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible // indirect

go.sum

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ github.com/containernetworking/plugins v1.8.0 h1:WjGbV/0UQyo8A4qBsAh6GaDAtu1hevx
9393
github.com/containernetworking/plugins v1.8.0/go.mod h1:JG3BxoJifxxHBhG3hFyxyhid7JgRVBu/wtooGEvWf1c=
9494
github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4=
9595
github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec=
96-
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
9796
github.com/coreos/go-systemd/v22 v22.6.0 h1:aGVa/v8B7hpb0TKl0MWoAavPDmHvobFe5R5zn0bCJWo=
9897
github.com/coreos/go-systemd/v22 v22.6.0/go.mod h1:iG+pp635Fo7ZmV/j14KUcmEyWF+0X7Lua8rrTWzYgWU=
9998
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
@@ -246,7 +245,6 @@ github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6Wezm
246245
github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY=
247246
github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=
248247
github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
249-
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
250248
github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
251249
github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
252250
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
@@ -420,13 +418,6 @@ github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4
420418
github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
421419
github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo=
422420
github.com/maruel/natural v1.1.1/go.mod h1:v+Rfd79xlw1AgVBjbO0BEQmptqb5HvL/k9GRHB7ZKEg=
423-
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
424-
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
425-
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
426-
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
427-
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
428-
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
429-
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
430421
github.com/mdlayher/ethernet v0.0.0-20220221185849-529eae5b6118 h1:2oDp6OOhLxQ9JBoUuysVz9UZ9uI6oLUbvAZu0x8o+vE=
431422
github.com/mdlayher/ethernet v0.0.0-20220221185849-529eae5b6118/go.mod h1:ZFUnHIVchZ9lJoWoEGUg8Q3M4U8aNNWA3CVSUTkW4og=
432423
github.com/mdlayher/ethtool v0.0.0-20210210192532-2b88debcdd43/go.mod h1:+t7E0lkKfbBsebllff1xdTmyJt8lH37niI6kwFk9OTo=
@@ -608,9 +599,6 @@ github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/f
608599
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
609600
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
610601
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
611-
github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0=
612-
github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY=
613-
github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ=
614602
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
615603
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
616604
github.com/sagikazarmark/locafero v0.10.0 h1:FM8Cv6j2KqIhM2ZK7HZjm4mpj9NBktLgowT1aN9q5Cc=
@@ -922,7 +910,6 @@ golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBc
922910
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
923911
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
924912
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
925-
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
926913
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
927914
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
928915
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

pkg/ovs/ovn-nb-bfd_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ package ovs
33
import (
44
"testing"
55

6-
"github.com/google/uuid"
76
"github.com/scylladb/go-set/strset"
8-
97
"github.com/stretchr/testify/require"
108

9+
"k8s.io/apimachinery/pkg/util/uuid"
10+
1111
"github.com/kubeovn/kube-ovn/pkg/ovsdb/ovnnb"
1212
)
1313

@@ -197,7 +197,7 @@ func (suite *OvnClientTestSuite) testDeleteBFD() {
197197
t.Run("delete non-existent BFD", func(t *testing.T) {
198198
t.Parallel()
199199

200-
err := nbClient.DeleteBFD(uuid.New().String())
200+
err := nbClient.DeleteBFD(string(uuid.NewUUID()))
201201
require.NoError(t, err)
202202
})
203203

@@ -206,7 +206,7 @@ func (suite *OvnClientTestSuite) testDeleteBFD() {
206206

207207
_, err := failedNbClient.CreateBFD(lrpName, dstIP1, minRx1, minTx1, detectMult1, nil)
208208
require.Error(t, err)
209-
err = failedNbClient.DeleteBFD(uuid.New().String())
209+
err = failedNbClient.DeleteBFD(string(uuid.NewUUID()))
210210
// cache db should be empty
211211
require.NoError(t, err)
212212
})

pkg/ovs/ovn-nb-logical_switch_port_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import (
55
"strings"
66
"testing"
77

8-
"github.com/google/uuid"
98
"github.com/ovn-kubernetes/libovsdb/ovsdb"
109
"github.com/stretchr/testify/require"
10+
"k8s.io/apimachinery/pkg/util/uuid"
1111

1212
ovsclient "github.com/kubeovn/kube-ovn/pkg/ovsdb/client"
1313
"github.com/kubeovn/kube-ovn/pkg/ovsdb/ovnnb"
@@ -1806,15 +1806,15 @@ func (suite *OvnClientTestSuite) testDeleteLogicalSwitchPortOp() {
18061806
})
18071807

18081808
t.Run("delete nonexistent logical switch port", func(t *testing.T) {
1809-
_, err := nbClient.DeleteLogicalSwitchPortOp("", uuid.NewString())
1809+
_, err := nbClient.DeleteLogicalSwitchPortOp("", string(uuid.NewUUID()))
18101810
require.Error(t, err)
18111811
})
18121812

18131813
t.Run("failed client delete nonexistent logical switch port", func(t *testing.T) {
18141814
ops, err := failedNbClient.DeleteLogicalSwitchPortOp("", "")
18151815
require.Error(t, err)
18161816
require.Nil(t, ops)
1817-
_, err = failedNbClient.DeleteLogicalSwitchPortOp("", uuid.NewString())
1817+
_, err = failedNbClient.DeleteLogicalSwitchPortOp("", string(uuid.NewUUID()))
18181818
require.Error(t, err)
18191819
})
18201820

pkg/ovs/ovn-nb-logical_switch_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import (
55
"strings"
66
"testing"
77

8-
"github.com/google/uuid"
98
"github.com/ovn-kubernetes/libovsdb/model"
109
"github.com/ovn-kubernetes/libovsdb/ovsdb"
10+
"k8s.io/apimachinery/pkg/util/uuid"
1111
"k8s.io/klog/v2"
1212

1313
"github.com/stretchr/testify/require"
@@ -511,7 +511,7 @@ func (suite *OvnClientTestSuite) testLogicalSwitchUpdatePortOp() {
511511

512512
t.Run("should return err when logical switch does not exist", func(t *testing.T) {
513513
t.Parallel()
514-
_, err := nbClient.LogicalSwitchUpdatePortOp("test-update-port-op-ls-non-existent", uuid.NewString(), ovsdb.MutateOperationInsert)
514+
_, err := nbClient.LogicalSwitchUpdatePortOp("test-update-port-op-ls-non-existent", string(uuid.NewUUID()), ovsdb.MutateOperationInsert)
515515
require.ErrorContains(t, err, "not found logical switch")
516516
})
517517

pkg/util/k8s_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@ import (
1111
"testing"
1212
"time"
1313

14-
"github.com/google/uuid"
1514
nadv1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1"
1615
appsv1 "k8s.io/api/apps/v1"
1716
v1 "k8s.io/api/core/v1"
1817
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1918
"k8s.io/apimachinery/pkg/labels"
20-
"k8s.io/apimachinery/pkg/types"
19+
"k8s.io/apimachinery/pkg/util/uuid"
2120
"k8s.io/klog/v2"
2221
"k8s.io/utils/ptr"
2322

@@ -459,7 +458,7 @@ func TestSetOwnerReference(t *testing.T) {
459458
owner: &kubeovnv1.VpcEgressGateway{
460459
ObjectMeta: metav1.ObjectMeta{
461460
Name: fmt.Sprintf("veg-%05d", rand.IntN(10000)),
462-
UID: types.UID(uuid.New().String()),
461+
UID: uuid.NewUUID(),
463462
},
464463
},
465464
object: &v1.Pod{},
@@ -469,7 +468,7 @@ func TestSetOwnerReference(t *testing.T) {
469468
owner: &v1.Pod{
470469
ObjectMeta: metav1.ObjectMeta{
471470
Name: fmt.Sprintf("veg-%05d", rand.IntN(10000)),
472-
UID: types.UID(uuid.New().String()),
471+
UID: uuid.NewUUID(),
473472
},
474473
},
475474
object: &v1.Pod{},

test/e2e/framework/http/http.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import (
55
"net/http"
66
"testing"
77
"time"
8-
9-
"github.com/rs/zerolog"
108
)
119

1210
type Report struct {
@@ -19,10 +17,6 @@ type Report struct {
1917
Attachments string `json:"attachments,omitempty"`
2018
}
2119

22-
func init() {
23-
zerolog.SetGlobalLevel(zerolog.WarnLevel)
24-
}
25-
2620
func runCaseOnce(client *http.Client, method, url string, expectedStatusCode int) (failure *Report) {
2721
startTime := time.Now()
2822

@@ -83,9 +77,7 @@ LOOP:
8377
result.Index = i
8478
result.Name = name
8579
failures = append(failures, result)
86-
}
87-
88-
if interval != 0 {
80+
} else if interval != 0 {
8981
time.Sleep(time.Duration(interval) * time.Millisecond)
9082
}
9183
}

0 commit comments

Comments
 (0)