Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCPBUGS-861: Rebase openshift/etcd 4.12 onto v3.5.5 #144

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
7656477
Revert "trim the suffix dot from the srv.Target for etcd-client DNS l…
liggitt Apr 15, 2022
081b4e2
Add unit test for canonical SRV records
liggitt Apr 15, 2022
b872757
Merge pull request #13950 from liggitt/revert-srv-dot-3.5
ptabor Apr 19, 2022
5c68f2e
Update conssitent_index when applying fails
ahrtr Apr 14, 2022
c3c908e
Merge pull request #13946 from ahrtr/move_cindex_on_apply_fail_353
serathius Apr 21, 2022
08407ff
version: bump up to 3.5.4
serathius Apr 24, 2022
5c44c30
Update golang.org/x/crypto to latest
cmurphy Apr 21, 2022
8453b10
Merge pull request #13996 from cmurphy/update-crypto-3.5
ptabor May 5, 2022
cceb25d
server/auth: enable tokenProvider if recoved store enables auth
cfz Jul 2, 2021
b57881a
Merge pull request #13205 from cfz/cherry-pick-#13172
ptabor May 6, 2022
c76a010
scripts: Add tests for release scripts
serathius Apr 24, 2022
c4b0a56
Make DRY_RUN explicit
serathius Apr 26, 2022
2e76dfb
Merge pull request #14043 from serathius/test-release-3.5-v2
serathius May 16, 2022
c05b9b1
scripts: Avoid additional repo clone
serathius May 16, 2022
6aa934e
scripts: Detect staged files before building release
serathius May 18, 2022
73876b1
Merge pull request #14050 from serathius/avoid-clone-v3.5
serathius May 18, 2022
acb1ee9
Backport two lease related bug fixes to 3.5
ahrtr Jun 4, 2022
0be65da
Merge pull request #14087 from ahrtr/lease_revoke_race
serathius Jun 6, 2022
db0b67e
Add FileReader and FileBufReader utilities
ahrtr Jun 17, 2022
621cd7b
restrict the max size of each WAL entry to the remaining size of the …
ahrtr Jun 17, 2022
4443e14
Merge pull request #14127 from ahrtr/threshold_3.5
ahrtr Jun 17, 2022
df632ab
client/v3: do not overwrite authTokenBundle on dial
ahrtr Jun 17, 2022
c9f7473
Merge pull request #14132 from ahrtr/auth_bundle
serathius Jun 20, 2022
4df61af
Client: fix check for WithPrefix op
spzala Jun 29, 2022
57c1d92
Merge pull request #14187 from spzala/automated-cherry-pick-of-#14182…
ahrtr Jul 3, 2022
40d1a43
add the uint32Value data type
ahrtr Jul 13, 2022
437f377
Add flag `--max-concurrent-streams` to set the max concurrent stream …
ahrtr Jul 13, 2022
ff447b4
add e2e test cases to cover the maxConcurrentStreams
ahrtr Jul 13, 2022
fb71790
Merge pull request #14219 from ahrtr/3.5_backport_maxstream
ahrtr Jul 13, 2022
cbedaf9
Improve error message for incorrect values of ETCD_CLIENT_DEBUG
Jille Jul 13, 2022
3237289
Merge pull request #14222 from Jille/backport-14203
ahrtr Jul 15, 2022
e15c005
server/auth: protect rangePermCache with a RW lock
mitake Apr 17, 2022
9d7e108
Merge pull request #14227 from mitake/perm-cache-lock-3.5
serathius Jul 20, 2022
4c013c9
Change default sampling rate from 100% to 0%
damemi Aug 5, 2022
6145831
Merge pull request #14318 from damemi/3.5-tracing-sample
ahrtr Aug 6, 2022
2d7e490
etcdserver: bump OpenTelemetry to 1.0.1
ahrtr Aug 4, 2022
5a86ae2
move setupTracing into a separate file config_tracing.go
ahrtr Aug 4, 2022
2751c61
update all related dependencies
ahrtr Aug 4, 2022
8c5f110
Fix the failure in TestEndpointSwitchResolvesViolation
ahrtr Aug 5, 2022
8fdca41
Change default sampling rate from 100% to 0%
ahrtr Aug 6, 2022
9e95685
Merge pull request #14312 from ahrtr/3.5_bump_otl
ahrtr Aug 8, 2022
eab0b99
clientv3: close streams after use in lessor keepAliveOnce method
amdprophet Aug 17, 2022
6bab367
Merge pull request #14361 from amdprophet/3.5-close-keepalive-stream
ahrtr Aug 19, 2022
9ea5b1b
Refactor the keepAliveListener and keepAliveConn
ahrtr Aug 20, 2022
74aa38e
Merge pull request #14366 from ahrtr/keepalive_3.5_20220820
ahrtr Aug 24, 2022
67e4c59
Backport of pull/14354 to 3.5.5
biosvs Aug 29, 2022
204d883
[backport 3.5] server: don't panic in readonly serializable txn
Sep 1, 2022
fbb14f9
Merge pull request #14397 from biosvs/backport-grpc-proxy-endpoints-a…
serathius Sep 1, 2022
7eb696d
fix the potential data loss for clusters with only one member
ahrtr Aug 30, 2022
747bf5c
Merge pull request #14424 from serathius/one_member_data_loss_raft_3_5
ahrtr Sep 5, 2022
5c8aa08
move consistent_index forward when executing alarmList operation
ahrtr Sep 6, 2022
204c031
Merge pull request #14429 from ahrtr/alarm_list_ci_3.5
ahrtr Sep 6, 2022
d32de2c
server: Extract triggerCorruptAlarm to function
serathius Jun 13, 2022
35cbdf3
server: Extract corruption detection to dedicated struct
serathius Jun 13, 2022
78a6f38
server: Cover corruptionMonitor with tests
serathius Jun 13, 2022
336fef4
server: Test HashByRev values to make sure they don't change
serathius May 19, 2022
bc592c7
server: Extract unsafeHashByRev function
serathius May 17, 2022
3f26995
server: Move unsafeHashByRev to new hash.go file
serathius May 17, 2022
f5ed371
server: Extract kvHash struct
serathius May 17, 2022
679e327
server: Refactor hasher
serathius May 19, 2022
22d3e4e
server: Return error from scheduleCompaction
serathius May 18, 2022
ea684db
server: Move reading KV index inside scheduleCompaction function
serathius May 19, 2022
f1a759a
server: Fix range in mock not returning same number of keys and values
serathius May 19, 2022
21e5d5d
server: Calculate hash during compaction
serathius May 19, 2022
2b8dd0d
server: Pass revision as int
serathius May 19, 2022
991b429
server: Move adjusting revision to hasher
serathius May 19, 2022
1ff5992
server: Store real rv range in hasher
serathius May 19, 2022
a3f609d
server: Return revision range that hash was calcualted for
serathius May 19, 2022
6311072
server: Remove duplicated compaction revision
serathius May 19, 2022
7358362
server: Extract hasher to separate interface
serathius May 19, 2022
1200b10
server: Cache compaction hash for HashByRev API
serathius Jun 7, 2022
d3db3bc
tests: Add integration tests for compact hash
serathius Jun 7, 2022
00bc8da
tests: Add tests for HashByRev HTTP API
serathius Jun 7, 2022
037a898
tests: Unify TestCompactionHash and extend it to also Delete keys and…
serathius Jun 8, 2022
a8020a0
tests: Rename corruptHash to CorruptBBolt
serathius Jul 25, 2022
8d4ca10
tests: Move CorruptBBolt to testutil
serathius Jul 25, 2022
4a75e3d
server: Refactor compaction checker
serathius Jul 25, 2022
a56ec0b
tests: Cover periodic check in tests
serathius Jul 25, 2022
21fb173
server: Implement compaction hash checking
serathius May 20, 2022
5660bf0
server: Make corrtuption check optional and period configurable
serathius Jul 5, 2022
2ddb9e0
tests: Fix member id in CORRUPT alarm
serathius Jul 25, 2022
ba52d5a
Merge pull request #14282 from serathius/fix-checks-v3.5
serathius Sep 7, 2022
c79f96d
server/etcdmain: add build support for Apple M1
dbussink Dec 17, 2021
7639d93
server,test: refresh cache on each NewAuthStore
Aug 31, 2022
bb3fae4
Merge pull request #14409 from vivekpatani/release-3.5
mitake Sep 8, 2022
a5a33cb
Merge pull request #14436 from serathius/arm64
ahrtr Sep 8, 2022
eef5e22
testing: fix TestOpenWithMaxIndex cleanup
vsvastey Sep 3, 2022
16d72c0
Merge pull request #14440 from vsvastey/usr/vsvastey/open-with-max-in…
ahrtr Sep 8, 2022
243b7a1
etcdctl: fix move-leader for multiple endpoints
tjungblu Sep 8, 2022
646ba66
Merge pull request #14434 from tjungblu/bz_1918413_3.5
ahrtr Sep 8, 2022
6c26693
Merge pull request #14178 from lavacat/release-3.5-txn-panic
ahrtr Sep 13, 2022
2f1171f
fix the flaky test fix_TestV3AuthRestartMember_20220913 for 3.5
ahrtr Sep 13, 2022
2ba1bab
Merge pull request #14454 from ahrtr/fix_TestV3AuthRestartMember_2022…
ahrtr Sep 13, 2022
19002cf
version: bump up to 3.5.5
serathius Sep 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release
on: [push, pull_request]
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "1.16.15"
- run: |
git config --global user.email "[email protected]"
git config --global user.name "Github Action"
gpg --batch --gen-key <<EOF
%no-protection
Key-Type: 1
Key-Length: 2048
Subkey-Type: 1
Subkey-Length: 2048
Name-Real: Github Action
Name-Email: [email protected]
Expire-Date: 0
EOF
DRY_RUN=true BRANCH=release-3.5 ./scripts/release --no-upload --no-docker-push 3.5.99
1 change: 1 addition & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
GOARCH=amd64 PASSES='build' ./test.sh
GOARCH=386 PASSES='build' ./test.sh
GO_BUILD_FLAGS='-v -mod=readonly' GOOS=darwin GOARCH=amd64 ./build.sh
GO_BUILD_FLAGS='-v -mod=readonly' GOOS=darwin GOARCH=arm64 ./build.sh
GO_BUILD_FLAGS='-v -mod=readonly' GOOS=windows GOARCH=amd64 ./build.sh
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi -- are there 2 flags for darwin amd64?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That second arch flag for darwin is arm64 not amd64 i.e Apple Silicon or M1 cpus:
https://tip.golang.org/doc/go1.16#ports
etcd-io#14436

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep etcd 3.5.5 has m1 support now

GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=arm ./build.sh
GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=arm64 ./build.sh
Expand Down
2 changes: 1 addition & 1 deletion api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/golang/protobuf v1.5.2
github.com/grpc-ecosystem/grpc-gateway v1.16.0
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c
google.golang.org/grpc v1.38.0
google.golang.org/grpc v1.41.0
gopkg.in/yaml.v2 v2.4.0 // indirect
)

Expand Down
12 changes: 11 additions & 1 deletion api/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
Expand All @@ -29,6 +33,7 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
Expand All @@ -49,9 +54,11 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
Expand Down Expand Up @@ -127,8 +134,10 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
google.golang.org/grpc v1.38.0 h1:/9BgsAsa5nWe26HqOlvlgJnqBuktYOLCgjCPqsa56W0=
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
google.golang.org/grpc v1.41.0 h1:f+PlOh7QV4iIJkPrx5NQ7qaNGFQ3OTse67yaDHfju4E=
google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
Expand All @@ -146,5 +155,6 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
2 changes: 1 addition & 1 deletion api/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
var (
// MinClusterVersion is the min cluster version this etcd binary is compatible with.
MinClusterVersion = "3.0.0"
Version = "3.5.3"
Version = "3.5.5"
APIVersion = "unknown"

// Git SHA Value will be set during build
Expand Down
40 changes: 11 additions & 29 deletions bill-of-materials.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
}
]
},
{
"project": "github.com/cenkalti/backoff/v4",
"licenses": [
{
"type": "MIT License",
"confidence": 1
}
]
},
{
"project": "github.com/certifi/gocertifi",
"licenses": [
Expand Down Expand Up @@ -539,15 +548,6 @@
}
]
},
{
"project": "go.opentelemetry.io/contrib",
"licenses": [
{
"type": "Apache License 2.0",
"confidence": 1
}
]
},
{
"project": "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc",
"licenses": [
Expand All @@ -567,7 +567,7 @@
]
},
{
"project": "go.opentelemetry.io/otel/exporters/otlp",
"project": "go.opentelemetry.io/otel/exporters/otlp/otlptrace",
"licenses": [
{
"type": "Apache License 2.0",
Expand All @@ -576,7 +576,7 @@
]
},
{
"project": "go.opentelemetry.io/otel/metric",
"project": "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc",
"licenses": [
{
"type": "Apache License 2.0",
Expand All @@ -593,24 +593,6 @@
}
]
},
{
"project": "go.opentelemetry.io/otel/sdk/export/metric",
"licenses": [
{
"type": "Apache License 2.0",
"confidence": 1
}
]
},
{
"project": "go.opentelemetry.io/otel/sdk/metric",
"licenses": [
{
"type": "Apache License 2.0",
"confidence": 1
}
]
},
{
"project": "go.opentelemetry.io/otel/trace",
"licenses": [
Expand Down
60 changes: 60 additions & 0 deletions client/pkg/fileutil/filereader.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// Copyright 2022 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package fileutil

import (
"bufio"
"io"
"io/fs"
"os"
)

// FileReader is a wrapper of io.Reader. It also provides file info.
type FileReader interface {
io.Reader
FileInfo() (fs.FileInfo, error)
}

type fileReader struct {
*os.File
}

func NewFileReader(f *os.File) FileReader {
return &fileReader{f}
}

func (fr *fileReader) FileInfo() (fs.FileInfo, error) {
return fr.Stat()
}

// FileBufReader is a wrapper of bufio.Reader. It also provides file info.
type FileBufReader struct {
*bufio.Reader
fi fs.FileInfo
}

func NewFileBufReader(fr FileReader) *FileBufReader {
bufReader := bufio.NewReader(fr)
fi, err := fr.FileInfo()
if err != nil {
// This should never happen.
panic(err)
}
return &FileBufReader{bufReader, fi}
}

func (fbr *FileBufReader) FileInfo() fs.FileInfo {
return fbr.fi
}
44 changes: 44 additions & 0 deletions client/pkg/fileutil/filereader_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright 2022 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package fileutil

import (
"os"
"strings"
"testing"

"github.com/stretchr/testify/assert"
)

func TestFileBufReader(t *testing.T) {
f, err := os.CreateTemp(t.TempDir(), "wal")
if err != nil {
t.Errorf("Unexpected error: %v", err)
}
fi, err := f.Stat()
if err != nil {
t.Errorf("Unexpected error: %v", err)
}

fbr := NewFileBufReader(NewFileReader(f))

if !strings.HasPrefix(fbr.FileInfo().Name(), "wal") {
t.Errorf("Unexpected file name: %s", fbr.FileInfo().Name())
}
assert.Equal(t, fi.Size(), fbr.FileInfo().Size())
assert.Equal(t, fi.IsDir(), fbr.FileInfo().IsDir())
assert.Equal(t, fi.Mode(), fbr.FileInfo().Mode())
assert.Equal(t, fi.ModTime(), fbr.FileInfo().ModTime())
}
1 change: 1 addition & 0 deletions client/pkg/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ go 1.16

require (
github.com/coreos/go-systemd/v22 v22.3.2
github.com/stretchr/testify v1.7.0
go.uber.org/zap v1.17.0
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57
)
1 change: 1 addition & 0 deletions client/pkg/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ go.uber.org/zap v1.17.0 h1:MTjgFu6ZLKvY6Pvaqk97GlxNBuMpV4Hy/3P6tRGlI2U=
go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo=
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57 h1:F5Gozwx4I1xtr/sr/8CFbb57iKi3297KFs0QDbGN60A=
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
Expand Down
3 changes: 1 addition & 2 deletions client/pkg/srv/srv.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,9 @@ func GetClient(service, domain string, serviceName string) (*SRVClients, error)
return err
}
for _, srv := range addrs {
shortHost := strings.TrimSuffix(srv.Target, ".")
urls = append(urls, &url.URL{
Scheme: scheme,
Host: net.JoinHostPort(shortHost, fmt.Sprintf("%d", srv.Port)),
Host: net.JoinHostPort(srv.Target, fmt.Sprintf("%d", srv.Port)),
})
}
srvs = append(srvs, addrs...)
Expand Down
8 changes: 4 additions & 4 deletions client/pkg/srv/srv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,12 @@ func TestSRVDiscover(t *testing.T) {
},
{
[]*net.SRV{
{Target: "a.example.com.", Port: 2480},
{Target: "b.example.com.", Port: 2480},
{Target: "c.example.com", Port: 2480},
{Target: "a.example.com", Port: 2480},
{Target: "b.example.com", Port: 2480},
{Target: "c.example.com.", Port: 2480},
},
[]*net.SRV{},
[]string{"https://a.example.com:2480", "https://b.example.com:2480", "https://c.example.com:2480"},
[]string{"https://a.example.com:2480", "https://b.example.com:2480", "https://c.example.com.:2480"},
false,
},
}
Expand Down
Loading