Skip to content

Commit f45f962

Browse files
Merge pull request #238 from bowei/pr-fixconst
Fix compile errors due to non-const format strings
2 parents e553d08 + 2ca43ad commit f45f962

File tree

6 files changed

+19
-7
lines changed

6 files changed

+19
-7
lines changed

e2e/tcproute_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ func TestMeshWithMultipleTCPRoutes(t *testing.T) {
606606
// Update TCP rules by removing rule pointing to removed BackendService
607607
tcprs[0], err = buildTCPRoute(graphBuilder, "multiple-tcpr-0", meshURL, rules)
608608
if err != nil {
609-
t.Fatalf(fmt.Sprintf("buildTcpRoute(_, %s, multiple-tcpr-0, %v) = %v, want nil", meshURL, rules, err))
609+
t.Fatal(fmt.Sprintf("buildTcpRoute(_, %s, multiple-tcpr-0, %v) = %v, want nil", meshURL, rules, err))
610610
}
611611

612612
expectedActions := []exec.ActionMetadata{

e2e/test-helpers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func expectActions(got []exec.Action, want []exec.ActionMetadata) error {
4545
}
4646

4747
if diff := cmp.Diff(gotMap, wantMap); diff != "" {
48-
return fmt.Errorf(diff)
48+
return errors.New(diff)
4949
}
5050
return nil
5151
}

pkg/cloud/gen.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2024 Google LLC
2+
Copyright 2025 Google LLC
33

44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -3833,6 +3833,7 @@ func (g *GCEAddresses) AggregatedList(ctx context.Context, fl *filter.F, options
38333833
if fl != filter.None {
38343834
call.Filter(fl.String())
38353835
}
3836+
call.ReturnPartialSuccess(opts.returnPartialSuccess)
38363837

38373838
all := map[string][]*computega.Address{}
38383839
f := func(l *computega.AddressAggregatedList) error {
@@ -4306,6 +4307,7 @@ func (g *GCEAlphaAddresses) AggregatedList(ctx context.Context, fl *filter.F, op
43064307
if fl != filter.None {
43074308
call.Filter(fl.String())
43084309
}
4310+
call.ReturnPartialSuccess(opts.returnPartialSuccess)
43094311

43104312
all := map[string][]*computealpha.Address{}
43114313
f := func(l *computealpha.AddressAggregatedList) error {
@@ -4779,6 +4781,7 @@ func (g *GCEBetaAddresses) AggregatedList(ctx context.Context, fl *filter.F, opt
47794781
if fl != filter.None {
47804782
call.Filter(fl.String())
47814783
}
4784+
call.ReturnPartialSuccess(opts.returnPartialSuccess)
47824785

47834786
all := map[string][]*computebeta.Address{}
47844787
f := func(l *computebeta.AddressAggregatedList) error {
@@ -6434,6 +6437,7 @@ func (g *GCEBackendServices) AggregatedList(ctx context.Context, fl *filter.F, o
64346437
if fl != filter.None {
64356438
call.Filter(fl.String())
64366439
}
6440+
call.ReturnPartialSuccess(opts.returnPartialSuccess)
64376441

64386442
all := map[string][]*computega.BackendService{}
64396443
f := func(l *computega.BackendServiceAggregatedList) error {
@@ -7209,6 +7213,7 @@ func (g *GCEBetaBackendServices) AggregatedList(ctx context.Context, fl *filter.
72097213
if fl != filter.None {
72107214
call.Filter(fl.String())
72117215
}
7216+
call.ReturnPartialSuccess(opts.returnPartialSuccess)
72127217

72137218
all := map[string][]*computebeta.BackendService{}
72147219
f := func(l *computebeta.BackendServiceAggregatedList) error {
@@ -7949,6 +7954,7 @@ func (g *GCEAlphaBackendServices) AggregatedList(ctx context.Context, fl *filter
79497954
if fl != filter.None {
79507955
call.Filter(fl.String())
79517956
}
7957+
call.ReturnPartialSuccess(opts.returnPartialSuccess)
79527958

79537959
all := map[string][]*computealpha.BackendService{}
79547960
f := func(l *computealpha.BackendServiceAggregatedList) error {
@@ -27623,6 +27629,7 @@ func (g *GCEAlphaNetworkEndpointGroups) AggregatedList(ctx context.Context, fl *
2762327629
if fl != filter.None {
2762427630
call.Filter(fl.String())
2762527631
}
27632+
call.ReturnPartialSuccess(opts.returnPartialSuccess)
2762627633

2762727634
all := map[string][]*computealpha.NetworkEndpointGroup{}
2762827635
f := func(l *computealpha.NetworkEndpointGroupAggregatedList) error {
@@ -28267,6 +28274,7 @@ func (g *GCEBetaNetworkEndpointGroups) AggregatedList(ctx context.Context, fl *f
2826728274
if fl != filter.None {
2826828275
call.Filter(fl.String())
2826928276
}
28277+
call.ReturnPartialSuccess(opts.returnPartialSuccess)
2827028278

2827128279
all := map[string][]*computebeta.NetworkEndpointGroup{}
2827228280
f := func(l *computebeta.NetworkEndpointGroupAggregatedList) error {
@@ -28911,6 +28919,7 @@ func (g *GCENetworkEndpointGroups) AggregatedList(ctx context.Context, fl *filte
2891128919
if fl != filter.None {
2891228920
call.Filter(fl.String())
2891328921
}
28922+
call.ReturnPartialSuccess(opts.returnPartialSuccess)
2891428923

2891528924
all := map[string][]*computega.NetworkEndpointGroup{}
2891628925
f := func(l *computega.NetworkEndpointGroupAggregatedList) error {
@@ -33108,6 +33117,7 @@ func (g *GCEAlphaRouters) AggregatedList(ctx context.Context, fl *filter.F, opti
3310833117
if fl != filter.None {
3310933118
call.Filter(fl.String())
3311033119
}
33120+
call.ReturnPartialSuccess(opts.returnPartialSuccess)
3311133121

3311233122
all := map[string][]*computealpha.Router{}
3311333123
f := func(l *computealpha.RouterAggregatedList) error {
@@ -33770,6 +33780,7 @@ func (g *GCEBetaRouters) AggregatedList(ctx context.Context, fl *filter.F, optio
3377033780
if fl != filter.None {
3377133781
call.Filter(fl.String())
3377233782
}
33783+
call.ReturnPartialSuccess(opts.returnPartialSuccess)
3377333784

3377433785
all := map[string][]*computebeta.Router{}
3377533786
f := func(l *computebeta.RouterAggregatedList) error {
@@ -34422,6 +34433,7 @@ func (g *GCERouters) AggregatedList(ctx context.Context, fl *filter.F, options .
3442234433
if fl != filter.None {
3442334434
call.Filter(fl.String())
3442434435
}
34436+
call.ReturnPartialSuccess(opts.returnPartialSuccess)
3442534437

3442634438
all := map[string][]*computega.Router{}
3442734439
f := func(l *computega.RouterAggregatedList) error {

pkg/cloud/gen/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func gofmtContent(r io.Reader) string {
7474
cmd.Stderr = cmdErr
7575

7676
if err := cmd.Run(); err != nil {
77-
fmt.Fprintf(os.Stderr, cmdErr.String())
77+
fmt.Fprint(os.Stderr, cmdErr.String())
7878
panic(err)
7979
}
8080
return out.String()

pkg/cloud/gen_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2024 The Kubernetes Authors.
2+
Copyright 2025 The Kubernetes Authors.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

pkg/cloud/rgraph/exec/executor_parallel.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func (ex *parallelExecutor) runActionQueue(ctx context.Context) error {
110110
defer cancel()
111111
msg = fmt.Sprintf("%s with timeout %v.", msg, ex.config.Timeout)
112112
}
113-
klog.Infof(msg)
113+
klog.Info(msg)
114114
return ex.pq.Run(ctx, ex.runAction)
115115
}
116116

@@ -122,7 +122,7 @@ func (ex *parallelExecutor) waitForQueueOrphans(ctx context.Context) error {
122122
defer cancel()
123123
msg = fmt.Sprintf("%s with timeout %v.", msg, ex.config.WaitForOrphansTimeout)
124124
}
125-
klog.V(4).Infof(msg)
125+
klog.V(4).Info(msg)
126126
return ex.pq.WaitForOrphans(ctx)
127127
}
128128

0 commit comments

Comments
 (0)