Skip to content

Commit 13d71f8

Browse files
serathiusdusk125
authored andcommitted
Merge pull request etcd-io#16781 from chaochn47/release-3.5-backport-gRPC-update
[release-3.5]: upgrade gRPC-go to v1.52.0
1 parent d7ff3ce commit 13d71f8

File tree

20 files changed

+168
-467
lines changed

20 files changed

+168
-467
lines changed

api/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ require (
77
github.com/gogo/protobuf v1.3.2
88
github.com/golang/protobuf v1.5.2
99
github.com/grpc-ecosystem/grpc-gateway v1.16.0
10-
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c
11-
google.golang.org/grpc v1.47.0
10+
google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6
11+
google.golang.org/grpc v1.52.0
1212
)
1313

1414
require (
1515
golang.org/x/net v0.17.0 // indirect
1616
golang.org/x/sys v0.13.0 // indirect
1717
golang.org/x/text v0.13.0 // indirect
18-
google.golang.org/protobuf v1.27.1 // indirect
18+
google.golang.org/protobuf v1.28.1 // indirect
1919
gopkg.in/yaml.v2 v2.4.0 // indirect
2020
)
2121

api/go.sum

Lines changed: 7 additions & 63 deletions
Large diffs are not rendered by default.

client/v3/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
go.etcd.io/etcd/api/v3 v3.5.9
1010
go.etcd.io/etcd/client/pkg/v3 v3.5.9
1111
go.uber.org/zap v1.17.0
12-
google.golang.org/grpc v1.47.0
12+
google.golang.org/grpc v1.52.0
1313
sigs.k8s.io/yaml v1.2.0
1414
)
1515

@@ -29,8 +29,8 @@ require (
2929
golang.org/x/net v0.17.0 // indirect
3030
golang.org/x/sys v0.13.0 // indirect
3131
golang.org/x/text v0.13.0 // indirect
32-
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect
33-
google.golang.org/protobuf v1.27.1 // indirect
32+
google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 // indirect
33+
google.golang.org/protobuf v1.28.1 // indirect
3434
gopkg.in/yaml.v2 v2.4.0 // indirect
3535
)
3636

client/v3/go.sum

Lines changed: 7 additions & 88 deletions
Large diffs are not rendered by default.

client/v3/internal/endpoint/endpoint.go

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ func extractHostFromHostPort(ep string) string {
4141
return host
4242
}
4343

44-
func extractHostFromPath(pathStr string) string {
45-
return extractHostFromHostPort(path.Base(pathStr))
46-
}
47-
4844
// mustSplit2 returns the values from strings.SplitN(s, sep, 2).
4945
// If sep is not found, it returns ("", "", false) instead.
5046
func mustSplit2(s, sep string) (string, string) {
@@ -96,29 +92,29 @@ func translateEndpoint(ep string) (addr string, serverName string, requireCreds
9692
if strings.HasPrefix(ep, "unix:///") || strings.HasPrefix(ep, "unixs:///") {
9793
// absolute path case
9894
schema, absolutePath := mustSplit2(ep, "://")
99-
return "unix://" + absolutePath, extractHostFromPath(absolutePath), schemeToCredsRequirement(schema)
95+
return "unix://" + absolutePath, path.Base(absolutePath), schemeToCredsRequirement(schema)
10096
}
10197
if strings.HasPrefix(ep, "unix://") || strings.HasPrefix(ep, "unixs://") {
10298
// legacy etcd local path
10399
schema, localPath := mustSplit2(ep, "://")
104-
return "unix:" + localPath, extractHostFromPath(localPath), schemeToCredsRequirement(schema)
100+
return "unix:" + localPath, path.Base(localPath), schemeToCredsRequirement(schema)
105101
}
106102
schema, localPath := mustSplit2(ep, ":")
107-
return "unix:" + localPath, extractHostFromPath(localPath), schemeToCredsRequirement(schema)
103+
return "unix:" + localPath, path.Base(localPath), schemeToCredsRequirement(schema)
108104
}
109105

110106
if strings.Contains(ep, "://") {
111107
url, err := url.Parse(ep)
112108
if err != nil {
113-
return ep, extractHostFromHostPort(ep), CREDS_OPTIONAL
109+
return ep, ep, CREDS_OPTIONAL
114110
}
115111
if url.Scheme == "http" || url.Scheme == "https" {
116-
return url.Host, url.Hostname(), schemeToCredsRequirement(url.Scheme)
112+
return url.Host, url.Host, schemeToCredsRequirement(url.Scheme)
117113
}
118-
return ep, url.Hostname(), schemeToCredsRequirement(url.Scheme)
114+
return ep, url.Host, schemeToCredsRequirement(url.Scheme)
119115
}
120116
// Handles plain addresses like 10.0.0.44:437.
121-
return ep, extractHostFromHostPort(ep), CREDS_OPTIONAL
117+
return ep, ep, CREDS_OPTIONAL
122118
}
123119

124120
// RequiresCredentials returns whether given endpoint requires

client/v3/internal/endpoint/endpoint_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,35 @@ func Test_interpret(t *testing.T) {
2727
}{
2828
{"127.0.0.1", "127.0.0.1", "127.0.0.1", CREDS_OPTIONAL},
2929
{"localhost", "localhost", "localhost", CREDS_OPTIONAL},
30-
{"localhost:8080", "localhost:8080", "localhost", CREDS_OPTIONAL},
30+
{"localhost:8080", "localhost:8080", "localhost:8080", CREDS_OPTIONAL},
3131

3232
{"unix:127.0.0.1", "unix:127.0.0.1", "127.0.0.1", CREDS_OPTIONAL},
33-
{"unix:127.0.0.1:8080", "unix:127.0.0.1:8080", "127.0.0.1", CREDS_OPTIONAL},
33+
{"unix:127.0.0.1:8080", "unix:127.0.0.1:8080", "127.0.0.1:8080", CREDS_OPTIONAL},
3434

3535
{"unix://127.0.0.1", "unix:127.0.0.1", "127.0.0.1", CREDS_OPTIONAL},
36-
{"unix://127.0.0.1:8080", "unix:127.0.0.1:8080", "127.0.0.1", CREDS_OPTIONAL},
36+
{"unix://127.0.0.1:8080", "unix:127.0.0.1:8080", "127.0.0.1:8080", CREDS_OPTIONAL},
3737

3838
{"unixs:127.0.0.1", "unix:127.0.0.1", "127.0.0.1", CREDS_REQUIRE},
39-
{"unixs:127.0.0.1:8080", "unix:127.0.0.1:8080", "127.0.0.1", CREDS_REQUIRE},
39+
{"unixs:127.0.0.1:8080", "unix:127.0.0.1:8080", "127.0.0.1:8080", CREDS_REQUIRE},
4040
{"unixs://127.0.0.1", "unix:127.0.0.1", "127.0.0.1", CREDS_REQUIRE},
41-
{"unixs://127.0.0.1:8080", "unix:127.0.0.1:8080", "127.0.0.1", CREDS_REQUIRE},
41+
{"unixs://127.0.0.1:8080", "unix:127.0.0.1:8080", "127.0.0.1:8080", CREDS_REQUIRE},
4242

4343
{"http://127.0.0.1", "127.0.0.1", "127.0.0.1", CREDS_DROP},
44-
{"http://127.0.0.1:8080", "127.0.0.1:8080", "127.0.0.1", CREDS_DROP},
44+
{"http://127.0.0.1:8080", "127.0.0.1:8080", "127.0.0.1:8080", CREDS_DROP},
4545
{"https://127.0.0.1", "127.0.0.1", "127.0.0.1", CREDS_REQUIRE},
46-
{"https://127.0.0.1:8080", "127.0.0.1:8080", "127.0.0.1", CREDS_REQUIRE},
47-
{"https://localhost:20000", "localhost:20000", "localhost", CREDS_REQUIRE},
46+
{"https://127.0.0.1:8080", "127.0.0.1:8080", "127.0.0.1:8080", CREDS_REQUIRE},
47+
{"https://localhost:20000", "localhost:20000", "localhost:20000", CREDS_REQUIRE},
4848

4949
{"unix:///tmp/abc", "unix:///tmp/abc", "abc", CREDS_OPTIONAL},
5050
{"unixs:///tmp/abc", "unix:///tmp/abc", "abc", CREDS_REQUIRE},
51-
{"unix:///tmp/abc:1234", "unix:///tmp/abc:1234", "abc", CREDS_OPTIONAL},
52-
{"unixs:///tmp/abc:1234", "unix:///tmp/abc:1234", "abc", CREDS_REQUIRE},
51+
{"unix:///tmp/abc:1234", "unix:///tmp/abc:1234", "abc:1234", CREDS_OPTIONAL},
52+
{"unixs:///tmp/abc:1234", "unix:///tmp/abc:1234", "abc:1234", CREDS_REQUIRE},
5353
{"etcd.io", "etcd.io", "etcd.io", CREDS_OPTIONAL},
5454
{"http://etcd.io/abc", "etcd.io", "etcd.io", CREDS_DROP},
5555
{"dns://something-other", "dns://something-other", "something-other", CREDS_OPTIONAL},
5656

57-
{"http://[2001:db8:1f70::999:de8:7648:6e8]:100/", "[2001:db8:1f70::999:de8:7648:6e8]:100", "2001:db8:1f70::999:de8:7648:6e8", CREDS_DROP},
58-
{"[2001:db8:1f70::999:de8:7648:6e8]:100", "[2001:db8:1f70::999:de8:7648:6e8]:100", "2001:db8:1f70::999:de8:7648:6e8", CREDS_OPTIONAL},
57+
{"http://[2001:db8:1f70::999:de8:7648:6e8]:100/", "[2001:db8:1f70::999:de8:7648:6e8]:100", "[2001:db8:1f70::999:de8:7648:6e8]:100", CREDS_DROP},
58+
{"[2001:db8:1f70::999:de8:7648:6e8]:100", "[2001:db8:1f70::999:de8:7648:6e8]:100", "[2001:db8:1f70::999:de8:7648:6e8]:100", CREDS_OPTIONAL},
5959
{"unix:unexpected-file_name#123$456", "unix:unexpected-file_name#123$456", "unexpected-file_name#123$456", CREDS_OPTIONAL},
6060
}
6161
for _, tt := range tests {

etcdctl/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ require (
1717
go.etcd.io/etcd/pkg/v3 v3.5.9
1818
go.uber.org/zap v1.17.0
1919
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba
20-
google.golang.org/grpc v1.47.0
20+
google.golang.org/grpc v1.52.0
2121
gopkg.in/cheggaaa/pb.v1 v1.0.28
2222
)
2323

@@ -57,8 +57,8 @@ require (
5757
golang.org/x/net v0.17.0 // indirect
5858
golang.org/x/sys v0.13.0 // indirect
5959
golang.org/x/text v0.13.0 // indirect
60-
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect
61-
google.golang.org/protobuf v1.27.1 // indirect
60+
google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 // indirect
61+
google.golang.org/protobuf v1.28.1 // indirect
6262
)
6363

6464
replace (

0 commit comments

Comments
 (0)