Skip to content

Commit 3367c7b

Browse files
author
Dmitriy Matrenichev
committed
chore: add proto-codec/codec
Unify usage of proto codec v2 across out projects. Signed-off-by: Dmitriy Matrenichev <[email protected]>
1 parent efbb10b commit 3367c7b

File tree

8 files changed

+36
-184
lines changed

8 files changed

+36
-184
lines changed

Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# syntax = docker/dockerfile-upstream:1.9.0-labs
1+
# syntax = docker/dockerfile-upstream:1.10.0-labs
22

33
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
44
#
5-
# Generated on 2024-09-02T13:05:25Z by kres b5ca957.
5+
# Generated on 2024-10-02T15:00:30Z by kres 34e72ac.
66

77
ARG TOOLCHAIN
88

9-
FROM ghcr.io/siderolabs/ca-certificates:v1.7.0 AS image-ca-certificates
9+
FROM ghcr.io/siderolabs/ca-certificates:v1.8.0 AS image-ca-certificates
1010

11-
FROM ghcr.io/siderolabs/fhs:v1.7.0 AS image-fhs
11+
FROM ghcr.io/siderolabs/fhs:v1.8.0 AS image-fhs
1212

1313
# runs markdownlint
14-
FROM docker.io/oven/bun:1.1.26-alpine AS lint-markdown
14+
FROM docker.io/oven/bun:1.1.29-alpine AS lint-markdown
1515
WORKDIR /src
1616
1717
COPY .markdownlint.json .

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2024-09-02T13:05:25Z by kres b5ca957.
3+
# Generated on 2024-10-02T15:00:30Z by kres 34e72ac.
44

55
# common variables
66

@@ -21,11 +21,11 @@ PROTOBUF_GO_VERSION ?= 1.34.2
2121
GRPC_GO_VERSION ?= 1.5.1
2222
GRPC_GATEWAY_VERSION ?= 2.22.0
2323
VTPROTOBUF_VERSION ?= 0.6.0
24-
GOIMPORTS_VERSION ?= 0.24.0
24+
GOIMPORTS_VERSION ?= 0.25.0
2525
DEEPCOPY_VERSION ?= v0.5.6
26-
GOLANGCILINT_VERSION ?= v1.60.3
26+
GOLANGCILINT_VERSION ?= v1.61.0
2727
GOFUMPT_VERSION ?= v0.7.0
28-
GO_VERSION ?= 1.23.0
28+
GO_VERSION ?= 1.23.2
2929
GO_BUILDFLAGS ?=
3030
GO_LDFLAGS ?=
3131
CGO_ENABLED ?= 0

cmd/discovery-service/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ import (
1717

1818
"github.com/prometheus/client_golang/prometheus"
1919
"github.com/siderolabs/go-debug"
20+
_ "github.com/siderolabs/proto-codec/codec" // enable vtproto codecV2
2021
"go.uber.org/zap"
2122

22-
_ "github.com/siderolabs/discovery-service/internal/proto"
2323
"github.com/siderolabs/discovery-service/pkg/service"
2424
)
2525

go.mod

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,19 @@ require (
77
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1
88
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0
99
github.com/jonboulle/clockwork v0.4.1-0.20231224152657-fc59783b0293
10-
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10
10+
github.com/planetscale/vtprotobuf v0.6.1-0.20240917153116-6f2963f01587
1111
github.com/prometheus/client_golang v1.20.4
1212
github.com/siderolabs/discovery-api v0.1.4
1313
github.com/siderolabs/discovery-client v0.1.10
1414
github.com/siderolabs/gen v0.5.0
1515
github.com/siderolabs/go-debug v0.4.0
16+
github.com/siderolabs/proto-codec v0.1.1
1617
github.com/stretchr/testify v1.9.0
1718
go.uber.org/zap v1.27.0
18-
golang.org/x/net v0.28.0
19+
golang.org/x/net v0.29.0
1920
golang.org/x/sync v0.8.0
2021
golang.org/x/time v0.6.0
21-
google.golang.org/grpc v1.67.0
22+
google.golang.org/grpc v1.67.1
2223
google.golang.org/protobuf v1.34.2
2324
)
2425

@@ -27,16 +28,16 @@ require (
2728
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
2829
github.com/cespare/xxhash/v2 v2.3.0 // indirect
2930
github.com/davecgh/go-spew v1.1.1 // indirect
30-
github.com/klauspost/compress v1.17.9 // indirect
31+
github.com/klauspost/compress v1.17.10 // indirect
3132
github.com/kylelemons/godebug v1.1.0 // indirect
3233
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
3334
github.com/pmezard/go-difflib v1.0.0 // indirect
3435
github.com/prometheus/client_model v0.6.1 // indirect
35-
github.com/prometheus/common v0.57.0 // indirect
36+
github.com/prometheus/common v0.60.0 // indirect
3637
github.com/prometheus/procfs v0.15.1 // indirect
3738
go.uber.org/multierr v1.11.0 // indirect
38-
golang.org/x/sys v0.24.0 // indirect
39-
golang.org/x/text v0.17.0 // indirect
39+
golang.org/x/sys v0.25.0 // indirect
40+
golang.org/x/text v0.18.0 // indirect
4041
google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed // indirect
4142
gopkg.in/yaml.v3 v3.0.1 // indirect
4243
)

go.sum

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 h1:pRhl55Yx1eC7BZ1N+BBWwn
1616
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0/go.mod h1:XKMd7iuf/RGPSMJ/U4HP0zS2Z9Fh8Ps9a+6X26m/tmI=
1717
github.com/jonboulle/clockwork v0.4.1-0.20231224152657-fc59783b0293 h1:l3TVsYI+QxIp0CW7YCizx9WG26Lj7DXnc1pdlBKk3gY=
1818
github.com/jonboulle/clockwork v0.4.1-0.20231224152657-fc59783b0293/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc=
19-
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
20-
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
19+
github.com/klauspost/compress v1.17.10 h1:oXAz+Vh0PMUvJczoi+flxpnBEPxoER1IaAnU/NMPtT0=
20+
github.com/klauspost/compress v1.17.10/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
2121
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
2222
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
2323
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
@@ -26,16 +26,16 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0
2626
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
2727
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
2828
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
29-
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo=
30-
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8=
29+
github.com/planetscale/vtprotobuf v0.6.1-0.20240917153116-6f2963f01587 h1:xzZOeCMQLA/W198ZkdVdt4EKFKJtS26B773zNU377ZY=
30+
github.com/planetscale/vtprotobuf v0.6.1-0.20240917153116-6f2963f01587/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8=
3131
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
3232
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
3333
github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI=
3434
github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
3535
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
3636
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
37-
github.com/prometheus/common v0.57.0 h1:Ro/rKjwdq9mZn1K5QPctzh+MA4Lp0BuYk5ZZEVhoNcY=
38-
github.com/prometheus/common v0.57.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI=
37+
github.com/prometheus/common v0.60.0 h1:+V9PAREWNvJMAuJ1x1BaWl9dewMW4YrHZQbx0sJNllA=
38+
github.com/prometheus/common v0.60.0/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw=
3939
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
4040
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
4141
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
@@ -48,6 +48,8 @@ github.com/siderolabs/gen v0.5.0 h1:Afdjx+zuZDf53eH5DB+E+T2JeCwBXGinV66A6osLgQI=
4848
github.com/siderolabs/gen v0.5.0/go.mod h1:1GUMBNliW98Xeq8GPQeVMYqQE09LFItE8enR3wgMh3Q=
4949
github.com/siderolabs/go-debug v0.4.0 h1:pbFt6Rzumm90s3GvbRer7yIxFNc0gQ94I53omkqswHA=
5050
github.com/siderolabs/go-debug v0.4.0/go.mod h1:9/dyHLRRIpqlJ0uTYyHo1XuZgoCgXzjjF+aIVTnr9Dc=
51+
github.com/siderolabs/proto-codec v0.1.1 h1:4jiUwW/vaXTZ+YNgZDs37B4aj/1mzV/erIkzUUCRY9g=
52+
github.com/siderolabs/proto-codec v0.1.1/go.mod h1:rIvmhKJG8+JwSCGPX+cQljpOMDmuHhLKPkt6KaFwEaU=
5153
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
5254
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
5355
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
@@ -56,20 +58,20 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
5658
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
5759
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
5860
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
59-
golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
60-
golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
61+
golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
62+
golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
6163
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
6264
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
63-
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
64-
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
65-
golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
66-
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
65+
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
66+
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
67+
golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
68+
golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
6769
golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U=
6870
golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
6971
google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed h1:J6izYgfBXAI3xTKLgxzTmUltdYaLsuBxFCgDHWJ/eXg=
7072
google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
71-
google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw=
72-
google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
73+
google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E=
74+
google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
7375
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
7476
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
7577
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

internal/proto/proto.go

Lines changed: 0 additions & 151 deletions
This file was deleted.

pkg/server/logging.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func AddLoggingFieldsStreamServerInterceptor() grpc.StreamServerInterceptor {
5050
ctx := ss.Context()
5151

5252
wrapped := grpc_middleware.WrapServerStream(ss)
53-
wrapped.WrappedContext = logging.InjectFields(ctx, fieldExtractor(ctx, nil))
53+
wrapped.WrappedContext = logging.InjectFields(ctx, fieldExtractor(ctx, nil)) //nolint:fatcontext
5454

5555
return handler(srv, wrapped)
5656
}

pkg/server/server_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
prom "github.com/prometheus/client_golang/prometheus"
2121
promtestutil "github.com/prometheus/client_golang/prometheus/testutil"
2222
"github.com/siderolabs/discovery-api/api/v1alpha1/server/pb"
23+
_ "github.com/siderolabs/proto-codec/codec"
2324
"github.com/stretchr/testify/assert"
2425
"github.com/stretchr/testify/require"
2526
"go.uber.org/zap/zaptest"
@@ -35,7 +36,6 @@ import (
3536

3637
"github.com/siderolabs/discovery-service/internal/grpclog"
3738
"github.com/siderolabs/discovery-service/internal/limiter"
38-
_ "github.com/siderolabs/discovery-service/internal/proto"
3939
"github.com/siderolabs/discovery-service/internal/state"
4040
"github.com/siderolabs/discovery-service/pkg/limits"
4141
"github.com/siderolabs/discovery-service/pkg/server"

0 commit comments

Comments
 (0)