diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2d1a108..ba806bee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,13 +13,13 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.2 - name: Set up QEMU uses: docker/setup-qemu-action@v3.2.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3.6.1 + uses: docker/setup-buildx-action@v3.7.1 - name: Login to GitHub Container Registry uses: docker/login-action@v3.3.0 @@ -36,7 +36,7 @@ jobs: run: make unit-tests - name: codecov - uses: codecov/codecov-action@v4.5.0 + uses: codecov/codecov-action@v5.0.7 with: files: ./_out/coverage-unit-tests.txt - diff --git a/.golangci.yml b/.golangci.yml index b36ac138..4552c93d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,6 @@ # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2024-06-03T10:33:42Z by kres f292767. +# Generated on 2024-12-04T08:00:06Z by kres 232fe63. # options for analysis running run: @@ -116,7 +116,6 @@ linters: - gochecknoglobals - gochecknoinits - godox - - gomnd - gomoddirectives - gosec - inamedparam diff --git a/Dockerfile b/Dockerfile index e7bbb52b..e1156ebe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -# syntax = docker/dockerfile-upstream:1.10.0-labs +# syntax = docker/dockerfile-upstream:1.11.1-labs # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2024-10-31T12:35:55Z by kres 6d3cad4. +# Generated on 2024-12-04T08:00:06Z by kres 232fe63. ARG TOOLCHAIN @@ -11,9 +11,9 @@ FROM ghcr.io/siderolabs/ca-certificates:v1.8.0 AS image-ca-certificates FROM ghcr.io/siderolabs/fhs:v1.8.0 AS image-fhs # runs markdownlint -FROM docker.io/oven/bun:1.1.32-alpine AS lint-markdown +FROM docker.io/oven/bun:1.1.36-alpine AS lint-markdown WORKDIR /src -RUN bun i markdownlint-cli@0.42.0 sentences-per-line@0.2.1 +RUN bun i markdownlint-cli@0.43.0 sentences-per-line@0.2.1 COPY .markdownlint.json . COPY ./README.md ./README.md RUN bunx markdownlint --ignore "CHANGELOG.md" --ignore "**/node_modules/**" --ignore '**/hack/chglog/**' --rules node_modules/sentences-per-line/index.js . diff --git a/Makefile b/Makefile index 94bd99a6..f95f28fd 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2024-10-31T12:35:55Z by kres 6d3cad4. +# Generated on 2024-12-04T08:00:06Z by kres 232fe63. # common variables @@ -17,15 +17,15 @@ WITH_RACE ?= false REGISTRY ?= ghcr.io USERNAME ?= cosi-project REGISTRY_AND_USERNAME ?= $(REGISTRY)/$(USERNAME) -PROTOBUF_GO_VERSION ?= 1.35.1 +PROTOBUF_GO_VERSION ?= 1.35.2 GRPC_GO_VERSION ?= 1.5.1 -GRPC_GATEWAY_VERSION ?= 2.22.0 +GRPC_GATEWAY_VERSION ?= 2.24.0 VTPROTOBUF_VERSION ?= 0.6.0 -GOIMPORTS_VERSION ?= 0.26.0 +GOIMPORTS_VERSION ?= 0.27.0 DEEPCOPY_VERSION ?= v0.5.6 -GOLANGCILINT_VERSION ?= v1.61.0 +GOLANGCILINT_VERSION ?= v1.62.0 GOFUMPT_VERSION ?= v0.7.0 -GO_VERSION ?= 1.23.2 +GO_VERSION ?= 1.23.3 GO_BUILDFLAGS ?= GO_LDFLAGS ?= CGO_ENABLED ?= 0 @@ -41,11 +41,13 @@ PLATFORM ?= linux/amd64 PROGRESS ?= auto PUSH ?= false CI_ARGS ?= +BUILDKIT_MULTI_PLATFORM ?= 1 COMMON_ARGS = --file=Dockerfile COMMON_ARGS += --provenance=false COMMON_ARGS += --progress=$(PROGRESS) COMMON_ARGS += --platform=$(PLATFORM) COMMON_ARGS += --push=$(PUSH) +COMMON_ARGS += --build-arg=BUILDKIT_MULTI_PLATFORM=$(BUILDKIT_MULTI_PLATFORM) COMMON_ARGS += --build-arg=ARTIFACTS="$(ARTIFACTS)" COMMON_ARGS += --build-arg=SHA="$(SHA)" COMMON_ARGS += --build-arg=TAG="$(TAG)" @@ -145,9 +147,18 @@ target-%: ## Builds the specified target defined in the Dockerfile. The build r local-%: ## Builds the specified target defined in the Dockerfile using the local output type. The build result will be output to the specified local destination. @$(MAKE) target-$* TARGET_ARGS="--output=type=local,dest=$(DEST) $(TARGET_ARGS)" + @PLATFORM=$(PLATFORM) DEST=$(DEST) bash -c '\ + for platform in $$(tr "," "\n" <<< "$$PLATFORM"); do \ + echo $$platform; \ + directory="$${platform//\//_}"; \ + if [[ -d "$$DEST/$$directory" ]]; then \ + mv "$$DEST/$$directory/"* $$DEST; \ + rmdir "$$DEST/$$directory/"; \ + fi; \ + done' generate: ## Generate .proto definitions. - @$(MAKE) local-$@ DEST=./ + @$(MAKE) local-$@ DEST=./ BUILDKIT_MULTI_PLATFORM=0 lint-golangci-lint: ## Runs golangci-lint linter. @$(MAKE) target-$@ diff --git a/go.mod b/go.mod index 93ec8191..7aaefa8a 100644 --- a/go.mod +++ b/go.mod @@ -7,44 +7,44 @@ go 1.23.0 replace gopkg.in/yaml.v3 => github.com/unix4ever/yaml v0.0.0-20220527175918-f17b0f05cf2c require ( - github.com/ProtonMail/gopenpgp/v2 v2.7.5 + github.com/ProtonMail/gopenpgp/v2 v2.8.1 github.com/cenkalti/backoff/v4 v4.3.0 github.com/gertd/go-pluralize v0.2.1 - github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0 github.com/hashicorp/go-multierror v1.1.1 - github.com/klauspost/compress v1.17.9 + github.com/klauspost/compress v1.17.11 github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 - github.com/siderolabs/gen v0.5.0 + github.com/siderolabs/gen v0.7.0 github.com/siderolabs/go-pointer v1.0.0 github.com/siderolabs/go-retry v0.3.3 github.com/siderolabs/protoenc v0.2.1 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.etcd.io/bbolt v1.3.11 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 - golang.org/x/sync v0.8.0 - golang.org/x/time v0.6.0 - google.golang.org/grpc v1.66.2 - google.golang.org/protobuf v1.34.2 + golang.org/x/sync v0.9.0 + golang.org/x/time v0.8.0 + google.golang.org/grpc v1.68.0 + google.golang.org/protobuf v1.35.2 gopkg.in/yaml.v3 v3.0.1 ) require ( - github.com/ProtonMail/go-crypto v1.1.0-alpha.5.0.20240827111422-b5837fa4476e // indirect + github.com/ProtonMail/go-crypto v1.1.3 // indirect github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f // indirect - github.com/cloudflare/circl v1.3.9 // indirect + github.com/cloudflare/circl v1.5.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rogpeppe/go-internal v1.12.0 // indirect + github.com/rogpeppe/go-internal v1.13.1 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.26.0 // indirect - golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.24.0 // indirect - golang.org/x/text v0.17.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed // indirect + golang.org/x/crypto v0.29.0 // indirect + golang.org/x/net v0.31.0 // indirect + golang.org/x/sys v0.27.0 // indirect + golang.org/x/text v0.20.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a // indirect ) retract v0.4.7 // Wait with locked mutex leads to the deadlock diff --git a/go.sum b/go.sum index 0e9b8ba2..cb5056ee 100644 --- a/go.sum +++ b/go.sum @@ -1,34 +1,32 @@ -github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= -github.com/ProtonMail/go-crypto v1.1.0-alpha.5.0.20240827111422-b5837fa4476e h1:O1cSHAcGcbGEO66Qi2AIJeYmXO8iP4L/PNrbdN+RjJA= -github.com/ProtonMail/go-crypto v1.1.0-alpha.5.0.20240827111422-b5837fa4476e/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= +github.com/ProtonMail/go-crypto v1.1.3 h1:nRBOetoydLeUb4nHajyO2bKqMLfWQ/ZPwkXqXxPxCFk= +github.com/ProtonMail/go-crypto v1.1.3/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f h1:tCbYj7/299ekTTXpdwKYF8eBlsYsDVoggDAuAjoK66k= github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f/go.mod h1:gcr0kNtGBqin9zDW9GOHcVntrwnjrK+qdJ06mWYBybw= -github.com/ProtonMail/gopenpgp/v2 v2.7.5 h1:STOY3vgES59gNgoOt2w0nyHBjKViB/qSg7NjbQWPJkA= -github.com/ProtonMail/gopenpgp/v2 v2.7.5/go.mod h1:IhkNEDaxec6NyzSI0PlxapinnwPVIESk8/76da3Ct3g= +github.com/ProtonMail/gopenpgp/v2 v2.8.1 h1:WGE1THOhOnLurL0+N4BOlLkIhjEO7YVZgmpgyDHN56A= +github.com/ProtonMail/gopenpgp/v2 v2.8.1/go.mod h1:4PUgqGSQjd7HldUbAgMmC69+Gv6DO8NomCNi0y8+BTc= github.com/brianvoe/gofakeit/v6 v6.24.0 h1:74yq7RRz/noddscZHRS2T84oHZisW9muwbb8sRnU52A= github.com/brianvoe/gofakeit/v6 v6.24.0/go.mod h1:Ow6qC71xtwm79anlwKRlWZW6zVq9D2XHE4QSSMP/rU8= -github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= -github.com/cloudflare/circl v1.3.9 h1:QFrlgFYf2Qpi8bSpVPK1HBvWpx16v/1TZivyo7pGuBE= -github.com/cloudflare/circl v1.3.9/go.mod h1:PDRU+oXvdD7KCtgKxW95M5Z8BpSCJXQORiZFnBQS5QU= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/cloudflare/circl v1.5.0 h1:hxIWksrX6XN5a1L2TI/h53AGPhNHoUBo+TD1ms9+pys= +github.com/cloudflare/circl v1.5.0/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/gertd/go-pluralize v0.2.1 h1:M3uASbVjMnTsPb0PNqg+E/24Vwigyo/tvyMTtAlLgiA= github.com/gertd/go-pluralize v0.2.1/go.mod h1:rbYaKDbsXxmRfr8uygAEKhOWsjyrrqrkHVpZvoOp8zk= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0 h1:TmHmbvxPmaegwhDubVz0lICL0J5Ka2vwTzhoePEXsGE= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0/go.mod h1:qztMSjm835F2bXf+5HKAPIS5qsmQDqZna/PgVt4rWtI= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -39,20 +37,18 @@ github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgm github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= -github.com/siderolabs/gen v0.5.0 h1:Afdjx+zuZDf53eH5DB+E+T2JeCwBXGinV66A6osLgQI= -github.com/siderolabs/gen v0.5.0/go.mod h1:1GUMBNliW98Xeq8GPQeVMYqQE09LFItE8enR3wgMh3Q= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/siderolabs/gen v0.7.0 h1:uHAt3WD0dof28NHFuguWBbDokaXQraR/HyVxCLw2QCU= +github.com/siderolabs/gen v0.7.0/go.mod h1:an3a2Y53O7kUjnnK8Bfu3gewtvnIOu5RTU6HalFtXQQ= github.com/siderolabs/go-pointer v1.0.0 h1:6TshPKep2doDQJAAtHUuHWXbca8ZfyRySjSBT/4GsMU= github.com/siderolabs/go-pointer v1.0.0/go.mod h1:HTRFUNYa3R+k0FFKNv11zgkaCLzEkWVzoYZ433P3kHc= github.com/siderolabs/go-retry v0.3.3 h1:zKV+S1vumtO72E6sYsLlmIdV/G/GcYSBLiEx/c9oCEg= github.com/siderolabs/go-retry v0.3.3/go.mod h1:Ff/VGc7v7un4uQg3DybgrmOWHEmJ8BzZds/XNn/BqMI= github.com/siderolabs/protoenc v0.2.1 h1:BqxEmeWQeMpNP3R6WrPqDatX8sM/r4t97OP8mFmg6GA= github.com/siderolabs/protoenc v0.2.1/go.mod h1:StTHxjet1g11GpNAWiATgc8K0HMKiFSEVVFOa/H0otc= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/unix4ever/yaml v0.0.0-20220527175918-f17b0f05cf2c h1:Vn6nVVu9MdOYvXPkJP83iX5jVIfvxFC9v9xIKb+DlaQ= github.com/unix4ever/yaml v0.0.0-20220527175918-f17b0f05cf2c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= @@ -66,64 +62,54 @@ go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= -golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= +golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= +golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= +golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= +golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= +golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= -golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= -golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= +golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= +golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed h1:3RgNmBoI9MZhsj3QxC+AP/qQhNwpCLOvYDYYsFrhFt0= -google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:OCdP9MfskevB/rbYvHTsXTtKC+3bHWajPdoKgjcYkfo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed h1:J6izYgfBXAI3xTKLgxzTmUltdYaLsuBxFCgDHWJ/eXg= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.66.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo= -google.golang.org/grpc v1.66.2/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a h1:OAiGFfOiA0v9MRYsSidp3ubZaBnteRUyn3xB2ZQ5G/E= +google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a/go.mod h1:jehYqy3+AhJU9ve55aNOaSml7wUXjF9x6z2LcCfpAhY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a h1:hgh8P4EuoxpsuKMXX/To36nOFD7vixReXgn8lPGnt+o= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= +google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0= +google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA= +google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= +google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/pkg/controller/conformance/resources.go b/pkg/controller/conformance/resources.go index f719622a..2fce6ef7 100644 --- a/pkg/controller/conformance/resources.go +++ b/pkg/controller/conformance/resources.go @@ -33,7 +33,7 @@ func NewIntResource(ns resource.Namespace, id resource.ID, value int) *IntResour return NewResource[int, intSpec, *intSpec](resource.NewMetadata(ns, IntResourceType, id, resource.VersionUndefined), value) } -type intSpec struct{ ValueGetSet[int] } +type intSpec struct{ ValueGetSet[int] } //nolint:recvcheck func (is *intSpec) FromProto(bytes []byte) { v, _ := binary.Varint(bytes) @@ -58,10 +58,10 @@ func NewStrResource(ns resource.Namespace, id resource.ID, value string) *StrRes return NewResource[string, strSpec, *strSpec](resource.NewMetadata(ns, StrResourceType, id, resource.VersionUndefined), value) } -type strSpec struct{ ValueGetSet[string] } +type strSpec struct{ ValueGetSet[string] } //nolint:recvcheck func (s *strSpec) FromProto(bytes []byte) { s.value = string(bytes) } -func (s strSpec) MarshalProto() ([]byte, error) { return []byte(s.value), nil } +func (s strSpec) MarshalProto() ([]byte, error) { return []byte(s.value + "stuff"), nil } // SentenceResourceType is the type of SentenceResource. const SentenceResourceType = resource.Type("test/sentence") @@ -74,7 +74,7 @@ func NewSentenceResource(ns resource.Namespace, id resource.ID, value string) *S return NewResource[string, sentenceSpec, *sentenceSpec](resource.NewMetadata(ns, SentenceResourceType, id, resource.VersionUndefined), value) } -type sentenceSpec struct{ ValueGetSet[string] } +type sentenceSpec struct{ ValueGetSet[string] } //nolint:recvcheck func (s *sentenceSpec) FromProto(bytes []byte) { s.value = string(bytes) } func (s sentenceSpec) MarshalProto() ([]byte, error) { return []byte(s.value), nil } diff --git a/pkg/controller/conformance/runtime.go b/pkg/controller/conformance/runtime.go index fe9be134..42be2fc9 100644 --- a/pkg/controller/conformance/runtime.go +++ b/pkg/controller/conformance/runtime.go @@ -502,7 +502,7 @@ func (suite *RuntimeSuite) TestControllerRuntimeMetrics() { return 0 } - return int(v.(*expvar.Int).Value()) //nolint:forcetypeassert + return int(v.(*expvar.Int).Value()) //nolint:forcetypeassert,errcheck } ctrl := &MetricsController{ diff --git a/pkg/controller/runtime/internal/cache/errors.go b/pkg/controller/runtime/internal/cache/errors.go index e77481cc..a8cec60a 100644 --- a/pkg/controller/runtime/internal/cache/errors.go +++ b/pkg/controller/runtime/internal/cache/errors.go @@ -10,6 +10,7 @@ import ( "github.com/cosi-project/runtime/pkg/resource" ) +//nolint:errname type eNotFound struct { error } diff --git a/pkg/resource/finalizer.go b/pkg/resource/finalizer.go index dc5693c7..11c66d3b 100644 --- a/pkg/resource/finalizer.go +++ b/pkg/resource/finalizer.go @@ -12,6 +12,8 @@ import "slices" type Finalizer = string // Finalizers is a set of Finalizer's with methods to add/remove items. +// +//nolint:recvcheck type Finalizers []Finalizer // Add a (unique) Finalizer to the set. diff --git a/pkg/resource/internal/kv/kv.go b/pkg/resource/internal/kv/kv.go index 7d2dc6a6..c8be7dcd 100644 --- a/pkg/resource/internal/kv/kv.go +++ b/pkg/resource/internal/kv/kv.go @@ -19,6 +19,8 @@ import ( // Order of keys is not guaranteed. // // KV support copy-on-write semantics, so metadata copies share common labels as long as possible. +// +//nolint:recvcheck type KV struct { m map[string]string } diff --git a/pkg/resource/meta/namespace.go b/pkg/resource/meta/namespace.go index 61aeddb5..ab3dd75f 100644 --- a/pkg/resource/meta/namespace.go +++ b/pkg/resource/meta/namespace.go @@ -40,6 +40,8 @@ func (NamespaceExtension) ResourceDefinition() ResourceDefinitionSpec { } // NamespaceSpec provides Namespace definition. +// +//nolint:recvcheck type NamespaceSpec struct { Description string `yaml:"description"` } diff --git a/pkg/resource/meta/spec/resource_definition.go b/pkg/resource/meta/spec/resource_definition.go index a066ada7..4eec1124 100644 --- a/pkg/resource/meta/spec/resource_definition.go +++ b/pkg/resource/meta/spec/resource_definition.go @@ -19,6 +19,8 @@ import ( ) // ResourceDefinitionSpec provides ResourceDefinition definition. +// +//nolint:recvcheck type ResourceDefinitionSpec struct { //nolint:govet // Canonical type name. Type resource.Type `yaml:"type"` diff --git a/pkg/resource/metadata.go b/pkg/resource/metadata.go index cec350ad..f62a5758 100644 --- a/pkg/resource/metadata.go +++ b/pkg/resource/metadata.go @@ -17,6 +17,8 @@ import ( var _ Reference = Metadata{} // Metadata implements resource meta. +// +//nolint:recvcheck type Metadata struct { created time.Time updated time.Time diff --git a/pkg/resource/protobuf/spec.go b/pkg/resource/protobuf/spec.go index a1d43bf5..b629024e 100644 --- a/pkg/resource/protobuf/spec.go +++ b/pkg/resource/protobuf/spec.go @@ -42,7 +42,7 @@ func (spec ResourceSpec[T, S]) DeepCopy() ResourceSpec[T, S] { } return ResourceSpec[T, S]{ - Value: proto.Clone(spec.Value).(S), //nolint:forcetypeassert + Value: proto.Clone(spec.Value).(S), //nolint:forcetypeassert,errcheck } } diff --git a/pkg/safe/state.go b/pkg/safe/state.go index 86187851..7fdf9135 100644 --- a/pkg/safe/state.go +++ b/pkg/safe/state.go @@ -208,7 +208,7 @@ func NewList[T any](list resource.List) List[T] { // Get returns the item at the given index. func (l *List[T]) Get(index int) T { //nolint:ireturn - return l.list.Items[index].(T) //nolint:forcetypeassert + return l.list.Items[index].(T) //nolint:forcetypeassert,errcheck } // Len returns the number of items in the list. @@ -219,7 +219,7 @@ func (l *List[T]) Len() int { // SortFunc is a function that sorts the list. func (l *List[T]) SortFunc(cmp func(T, T) int) { slices.SortFunc(l.list.Items, func(l, r resource.Resource) int { - return cmp(l.(T), r.(T)) //nolint:forcetypeassert + return cmp(l.(T), r.(T)) //nolint:forcetypeassert,errcheck }) } @@ -263,14 +263,14 @@ func (l *List[T]) ForEachErr(fn func(T) error) error { // ForEach iterates over the given list and calls the given function for each element. func (l *List[T]) ForEach(fn func(T)) { for _, r := range l.list.Items { - fn(r.(T)) //nolint:forcetypeassert + fn(r.(T)) //nolint:forcetypeassert,errcheck } } // Index returns the index of the given item in the list. func (l *List[T]) Index(fn func(T) bool) int { for i, r := range l.list.Items { - if fn(r.(T)) { //nolint:forcetypeassert + if fn(r.(T)) { //nolint:forcetypeassert,errcheck return i } } diff --git a/pkg/safe/util.go b/pkg/safe/util.go index fef624c5..6391912a 100644 --- a/pkg/safe/util.go +++ b/pkg/safe/util.go @@ -19,7 +19,7 @@ func Map[T any, R any](list List[T], fn func(T) (R, error)) ([]R, error) { result := make([]R, 0, list.Len()) for _, item := range list.list.Items { - r, err := fn(item.(T)) + r, err := fn(item.(T)) //nolint:errcheck if err != nil { return nil, err } @@ -35,7 +35,7 @@ func ToSlice[T any, R any](list List[T], fn func(T) R) []R { result := make([]R, 0, list.Len()) for _, item := range list.list.Items { - result = append(result, fn(item.(T))) //nolint:forcetypeassert + result = append(result, fn(item.(T))) //nolint:forcetypeassert,errcheck } return result diff --git a/pkg/state/errors.go b/pkg/state/errors.go index 86b847ae..dc87bb4c 100644 --- a/pkg/state/errors.go +++ b/pkg/state/errors.go @@ -115,12 +115,14 @@ func IsPhaseConflictError(err error) bool { return errors.As(err, &i) } +//nolint:errname type eConflict struct { error } func (eConflict) ConflictError() {} +//nolint:errname type ePhaseConflict struct { eConflict } diff --git a/pkg/state/impl/inmem/errors.go b/pkg/state/impl/inmem/errors.go index 0fed61ad..ae61b979 100644 --- a/pkg/state/impl/inmem/errors.go +++ b/pkg/state/impl/inmem/errors.go @@ -10,6 +10,7 @@ import ( "github.com/cosi-project/runtime/pkg/resource" ) +//nolint:errname type eNotFound struct { error } @@ -23,6 +24,7 @@ func ErrNotFound(r resource.Pointer) error { } } +//nolint:errname type eConflict struct { error resource resource.Pointer @@ -34,12 +36,14 @@ func (e eConflict) GetResource() resource.Pointer { return e.resource } +//nolint:errname type eOwnerConflict struct { eConflict } func (eOwnerConflict) OwnerConflictError() {} +//nolint:errname type ePhaseConflict struct { eConflict } diff --git a/pkg/state/protobuf/client/errors.go b/pkg/state/protobuf/client/errors.go index 0ad69097..0863dd1b 100644 --- a/pkg/state/protobuf/client/errors.go +++ b/pkg/state/protobuf/client/errors.go @@ -6,12 +6,14 @@ package client import "github.com/cosi-project/runtime/pkg/resource" +//nolint:errname type eNotFound struct { error } func (eNotFound) NotFoundError() {} +//nolint:errname type eConflict struct { error resource resource.Pointer @@ -23,12 +25,14 @@ func (e eConflict) GetResource() resource.Pointer { return e.resource } +//nolint:errname type eOwnerConflict struct { eConflict } func (eOwnerConflict) OwnerConflictError() {} +//nolint:errname type ePhaseConflict struct { eConflict }