Skip to content

Commit 6da0824

Browse files
Merge pull request #129519 from kishen-v/automated-cherry-pick-of-#127422-upstream-release-1.31
Automated cherry pick of #127422: Fix Go vet errors for master golang Kubernetes-commit: d7fc7e30cb630dab3351480c806c58a8c480156f
2 parents b39cc9a + 9688574 commit 6da0824

File tree

8 files changed

+11
-11
lines changed

8 files changed

+11
-11
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ require (
4747
gopkg.in/square/go-jose.v2 v2.6.0
4848
k8s.io/api v0.0.0-20240827081448-46f6230a4e83
4949
k8s.io/apimachinery v0.0.0-20240719190441-a8f449e276fe
50-
k8s.io/client-go v0.0.0-20240801004130-5e3e8ea98fe9
50+
k8s.io/client-go v0.0.0-20250122203833-8eaec8fb352c
5151
k8s.io/component-base v0.0.0-20240801005513-6332889bcf10
5252
k8s.io/klog/v2 v2.130.1
5353
k8s.io/kms v0.0.0-20240801005948-e16c35c51bb1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,8 @@ k8s.io/api v0.0.0-20240827081448-46f6230a4e83 h1:EHuPy/62w9Llhp491zNknjEuET9oMPQ
374374
k8s.io/api v0.0.0-20240827081448-46f6230a4e83/go.mod h1:sSxNOmsgxkyv9k7Nu9ysVYNCkTkTemOgz4HxbATSKDQ=
375375
k8s.io/apimachinery v0.0.0-20240719190441-a8f449e276fe h1:lt6b7CTEYMgUTCGIZrATyWMZTQThE+qIQq5YTCbpMVQ=
376376
k8s.io/apimachinery v0.0.0-20240719190441-a8f449e276fe/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
377-
k8s.io/client-go v0.0.0-20240801004130-5e3e8ea98fe9 h1:FtksMSsr8nNBmsSXlqvs3hPE/7BJ5wI/mJYjGypoEtk=
378-
k8s.io/client-go v0.0.0-20240801004130-5e3e8ea98fe9/go.mod h1:2bbCJ3Sd+yFlCoexz86XNKsJ8hBFUVTeHsjEhrODbfE=
377+
k8s.io/client-go v0.0.0-20250122203833-8eaec8fb352c h1:2KWIT9nRYHqRPUnJ7hPiWNRnvZjM29KezMf1jJHmS9w=
378+
k8s.io/client-go v0.0.0-20250122203833-8eaec8fb352c/go.mod h1:Ej+MeavJjLACzTBTUQxDzM/jq+XTcmChX/4PvmdDc9o=
379379
k8s.io/component-base v0.0.0-20240801005513-6332889bcf10 h1:tHph4IwKpAlb5BF1qvmAiZPsekcg7ulTIhHrGrw/OgY=
380380
k8s.io/component-base v0.0.0-20240801005513-6332889bcf10/go.mod h1:4BSQhq9G+cFOChP5FQhxewvI8nzmsOPyetLz/Gh2Npw=
381381
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=

pkg/cel/lazy/lazy_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func TestLazyMapType(t *testing.T) {
6060
evalCounter++
6161
v, err := compileAndRun(env, activation, `{"a": "a"}`)
6262
if err != nil {
63-
return types.NewErr(err.Error())
63+
return types.NewErr("%s", err.Error())
6464
}
6565
return v
6666
})

pkg/endpoints/apiserver_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2818,7 +2818,7 @@ func TestDeleteWithOptions(t *testing.T) {
28182818
if err != nil {
28192819
t.Fatalf("unexpected error: %v", err)
28202820
}
2821-
t.Logf(string(s))
2821+
t.Log(string(s))
28222822
}
28232823
if simpleStorage.deleted != ID {
28242824
t.Errorf("Unexpected delete: %s, expected %s", simpleStorage.deleted, ID)
@@ -2858,7 +2858,7 @@ func TestDeleteWithOptionsQuery(t *testing.T) {
28582858
if err != nil {
28592859
t.Fatalf("unexpected error: %v", err)
28602860
}
2861-
t.Logf(string(s))
2861+
t.Log(string(s))
28622862
}
28632863
if simpleStorage.deleted != ID {
28642864
t.Fatalf("Unexpected delete: %s, expected %s", simpleStorage.deleted, ID)
@@ -2901,7 +2901,7 @@ func TestDeleteWithOptionsQueryAndBody(t *testing.T) {
29012901
if err != nil {
29022902
t.Fatalf("unexpected error: %v", err)
29032903
}
2904-
t.Logf(string(s))
2904+
t.Log(string(s))
29052905
}
29062906
if simpleStorage.deleted != ID {
29072907
t.Errorf("Unexpected delete: %s, expected %s", simpleStorage.deleted, ID)

pkg/endpoints/handlers/responsewriters/writers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ func TestSerializeObject(t *testing.T) {
326326
compressionEnabled: true,
327327
statusCode: http.StatusInternalServerError,
328328
out: smallPayload,
329-
outErrs: []error{fmt.Errorf(string(largePayload)), fmt.Errorf("bad2")},
329+
outErrs: []error{errors.New(string(largePayload)), errors.New("bad2")},
330330
mediaType: "application/json",
331331
req: &http.Request{
332332
Header: http.Header{

pkg/server/filters/maxinflight.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ var (
5050
func handleError(w http.ResponseWriter, r *http.Request, err error) {
5151
errorMsg := fmt.Sprintf("Internal Server Error: %#v", r.RequestURI)
5252
http.Error(w, errorMsg, http.StatusInternalServerError)
53-
klog.Errorf(err.Error())
53+
klog.Error(err.Error())
5454
}
5555

5656
// requestWatermark is used to track maximal numbers of requests in a particular phase of handling

pkg/storage/cacher/cacher_whitebox_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1603,7 +1603,7 @@ func verifyEvents(t *testing.T, w watch.Interface, events []watch.Event, strictO
16031603
if !valid {
16041604
t.Logf("(called from line %d)", line)
16051605
for _, err := range errors {
1606-
t.Errorf(err)
1606+
t.Error(err)
16071607
}
16081608
}
16091609
}

pkg/util/peerproxy/peerproxy_handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func (h *peerProxyHandler) WrapHandler(handler http.Handler) http.Handler {
176176
// TODO: maintain locally serviceable GVRs somewhere so that we dont have to
177177
// consult the storageversion-informed map for those
178178
if len(serviceableByResp.peerEndpoints) == 0 {
179-
klog.Errorf(fmt.Sprintf("GVR %v is not served by anything in this cluster", gvr))
179+
klog.Error(fmt.Sprintf("GVR %v is not served by anything in this cluster", gvr))
180180
handler.ServeHTTP(w, r)
181181
return
182182
}

0 commit comments

Comments
 (0)