Skip to content

Commit 005e92c

Browse files
committed
chore: rekres and regen
Rekres and regen proto definitions. Signed-off-by: Andrey Smirnov <[email protected]>
1 parent e1dc7bb commit 005e92c

File tree

10 files changed

+323
-525
lines changed

10 files changed

+323
-525
lines changed

.github/workflows/ci.yaml

+29-12
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-03-12T12:43:51Z by kres latest.
3+
# Generated on 2024-10-22T08:55:07Z by kres 34e72ac.
44

55
name: default
66
concurrency:
@@ -29,27 +29,44 @@ jobs:
2929
- self-hosted
3030
- generic
3131
if: (!startsWith(github.head_ref, 'renovate/') && !startsWith(github.head_ref, 'dependabot/'))
32-
services:
33-
buildkitd:
34-
image: moby/buildkit:v0.12.5
35-
options: --privileged
36-
ports:
37-
- 1234:1234
38-
volumes:
39-
- /var/lib/buildkit/${{ github.repository }}:/var/lib/buildkit
40-
- /usr/etc/buildkit/buildkitd.toml:/etc/buildkit/buildkitd.toml
4132
steps:
33+
- name: gather-system-info
34+
id: system-info
35+
uses: kenchan0130/[email protected]
36+
continue-on-error: true
37+
- name: print-system-info
38+
run: |
39+
MEMORY_GB=$((${{ steps.system-info.outputs.totalmem }}/1024/1024/1024))
40+
41+
OUTPUTS=(
42+
"CPU Core: ${{ steps.system-info.outputs.cpu-core }}"
43+
"CPU Model: ${{ steps.system-info.outputs.cpu-model }}"
44+
"Hostname: ${{ steps.system-info.outputs.hostname }}"
45+
"NodeName: ${NODE_NAME}"
46+
"Kernel release: ${{ steps.system-info.outputs.kernel-release }}"
47+
"Kernel version: ${{ steps.system-info.outputs.kernel-version }}"
48+
"Name: ${{ steps.system-info.outputs.name }}"
49+
"Platform: ${{ steps.system-info.outputs.platform }}"
50+
"Release: ${{ steps.system-info.outputs.release }}"
51+
"Total memory: ${MEMORY_GB} GB"
52+
)
53+
54+
for OUTPUT in "${OUTPUTS[@]}";do
55+
echo "${OUTPUT}"
56+
done
57+
continue-on-error: true
4258
- name: checkout
4359
uses: actions/checkout@v4
4460
- name: Unshallow
4561
run: |
4662
git fetch --prune --unshallow
4763
- name: Set up Docker Buildx
64+
id: setup-buildx
4865
uses: docker/setup-buildx-action@v3
4966
with:
5067
driver: remote
51-
endpoint: tcp://127.0.0.1:1234
52-
timeout-minutes: 1
68+
endpoint: tcp://buildkit-amd64.ci.svc.cluster.local:1234
69+
timeout-minutes: 10
5370
- name: base
5471
run: |
5572
make base

.golangci.yml

+37-65
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2024-03-12T12:26:58Z by kres latest.
3+
# Generated on 2024-10-22T08:55:07Z by kres 34e72ac.
44

55
# options for analysis running
66
run:
77
timeout: 10m
88
issues-exit-code: 1
99
tests: true
10-
build-tags: []
11-
skip-dirs: []
12-
skip-dirs-use-default: true
13-
skip-files: []
10+
build-tags: [ ]
1411
modules-download-mode: readonly
1512

1613
# output configuration options
1714
output:
18-
format: colored-line-number
15+
formats:
16+
- format: colored-line-number
17+
path: stdout
1918
print-issued-lines: true
2019
print-linter-name: true
2120
uniq-by-line: true
@@ -32,54 +31,35 @@ linters-settings:
3231
check-blank: true
3332
exhaustive:
3433
default-signifies-exhaustive: false
35-
funlen:
36-
lines: 60
37-
statements: 40
3834
gci:
39-
local-prefixes: github.com/siderolabs/discovery-api/
35+
sections:
36+
- standard # Standard section: captures all standard packages.
37+
- default # Default section: contains all imports that could not be matched to another section type.
38+
- localmodule # Imports from the same module.
4039
gocognit:
4140
min-complexity: 30
42-
ireturn:
43-
allow:
44-
- anon
45-
- error
46-
- empty
47-
- stdlib
48-
- github.com\/talos-systems\/kres\/internal\/dag.Node
4941
nestif:
5042
min-complexity: 5
5143
goconst:
5244
min-len: 3
5345
min-occurrences: 3
5446
gocritic:
55-
disabled-checks: []
47+
disabled-checks: [ ]
5648
gocyclo:
5749
min-complexity: 20
5850
godot:
59-
check-all: false
60-
godox:
61-
keywords: # default keywords are TODO, BUG, and FIXME, these can be overwritten by this setting
62-
- NOTE
63-
- OPTIMIZE # marks code that should be optimized before merging
64-
- HACK # marks hack-arounds that should be removed before merging
51+
scope: declarations
6552
gofmt:
6653
simplify: true
67-
goimports:
68-
local-prefixes: github.com/siderolabs/discovery-api/
69-
golint:
70-
min-confidence: 0.8
71-
gomnd:
72-
settings: {}
73-
gomodguard: {}
54+
gomodguard: { }
7455
govet:
75-
check-shadowing: true
7656
enable-all: true
7757
lll:
7858
line-length: 200
7959
tab-width: 4
8060
misspell:
8161
locale: US
82-
ignore-words: []
62+
ignore-words: [ ]
8363
nakedret:
8464
max-func-lines: 30
8565
prealloc:
@@ -88,16 +68,15 @@ linters-settings:
8868
for-loops: false # Report preallocation suggestions on for loops, false by default
8969
nolintlint:
9070
allow-unused: false
91-
allow-leading-space: false
92-
allow-no-explanation: []
71+
allow-no-explanation: [ ]
9372
require-explanation: false
9473
require-specific: true
95-
rowserrcheck: {}
96-
testpackage: {}
74+
rowserrcheck: { }
75+
testpackage: { }
9776
unparam:
9877
check-exported: false
9978
unused:
100-
check-exported: false
79+
local-variables-are-used: false
10180
whitespace:
10281
multi-if: false # Enforces newlines (or comments) after every multi-line if statement
10382
multi-func: false # Enforces newlines (or comments) after every multi-line function signature
@@ -113,60 +92,53 @@ linters-settings:
11392
gofumpt:
11493
extra-rules: false
11594
cyclop:
116-
# the maximal code complexity to report
117-
max-complexity: 20
118-
# depguard:
119-
# Main:
120-
# deny:
121-
# - github.com/OpenPeeDeeP/depguard # this is just an example
95+
# the maximal code complexity to report
96+
max-complexity: 20
97+
depguard:
98+
rules:
99+
prevent_unmaintained_packages:
100+
list-mode: lax # allow unless explicitly denied
101+
files:
102+
- $all
103+
deny:
104+
- pkg: io/ioutil
105+
desc: "replaced by io and os packages since Go 1.16: https://tip.golang.org/doc/go1.16#ioutil"
122106

123107
linters:
124108
enable-all: true
125109
disable-all: false
126110
fast: false
127111
disable:
128112
- exhaustruct
129-
- exhaustivestruct
113+
- err113
130114
- forbidigo
131115
- funlen
132-
- gas
133116
- gochecknoglobals
134117
- gochecknoinits
135118
- godox
136-
- goerr113
137119
- gomnd
138120
- gomoddirectives
121+
- gosec
122+
- inamedparam
139123
- ireturn
124+
- mnd
140125
- nestif
141126
- nonamedreturns
142-
- nosnakecase
143127
- paralleltest
128+
- tagalign
144129
- tagliatelle
145130
- thelper
146-
- typecheck
147131
- varnamelen
148132
- wrapcheck
149-
- depguard # Disabled because starting with golangci-lint 1.53.0 it doesn't allow denylist alone anymore
150-
- tagalign
151-
- inamedparam
152133
- testifylint # complains about our assert recorder and has a number of false positives for assert.Greater(t, thing, 1)
153134
- protogetter # complains about us using Value field on typed spec, instead of GetValue which has a different signature
154135
- perfsprint # complains about us using fmt.Sprintf in non-performance critical code, updating just kres took too long
155-
# abandoned linters for which golangci shows the warning that the repo is archived by the owner
156-
- interfacer
157-
- maligned
158-
- golint
159-
- scopelint
160-
- varcheck
161-
- deadcode
162-
- structcheck
163-
- ifshort
164-
# disabled as it seems to be broken - goes into imported libraries and reports issues there
165-
- musttag
136+
- goimports # same as gci
137+
- musttag # seems to be broken - goes into imported libraries and reports issues there
166138

167139
issues:
168-
exclude: []
169-
exclude-rules: []
140+
exclude: [ ]
141+
exclude-rules: [ ]
170142
exclude-use-default: false
171143
exclude-case-sensitive: false
172144
max-issues-per-linter: 10

Dockerfile

+16-20
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
# syntax = docker/dockerfile-upstream:1.7.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-03-12T12:26:58Z by kres latest.
5+
# Generated on 2024-10-22T09:21:00Z by kres 6d3cad4.
66

77
ARG TOOLCHAIN
88

99
# runs markdownlint
10-
FROM docker.io/node:21.7.1-alpine3.19 AS lint-markdown
10+
FROM docker.io/oven/bun:1.1.32-alpine AS lint-markdown
1111
WORKDIR /src
12-
RUN npm i -g [email protected]
13-
12+
1413
COPY .markdownlint.json .
1514
COPY ./README.md ./README.md
16-
RUN markdownlint --ignore "CHANGELOG.md" --ignore "**/node_modules/**" --ignore '**/hack/chglog/**' --rules node_modules/sentences-per-line/index.js .
15+
RUN bunx markdownlint --ignore "CHANGELOG.md" --ignore "**/node_modules/**" --ignore '**/hack/chglog/**' --rules node_modules/sentences-per-line/index.js .
1716

1817
# collects proto specs
1918
FROM scratch AS proto-specs
@@ -22,19 +21,22 @@ ADD api/v1alpha1/server/cluster.proto /api/v1alpha1/server/pb/
2221
ADD api/v1alpha1/client/affiliate.proto /api/v1alpha1/client/pb/
2322

2423
# base toolchain image
25-
FROM ${TOOLCHAIN} AS toolchain
24+
FROM --platform=${BUILDPLATFORM} ${TOOLCHAIN} AS toolchain
2625
RUN apk --update --no-cache add bash curl build-base protoc protobuf-dev
2726

2827
# build tools
2928
FROM --platform=${BUILDPLATFORM} toolchain AS tools
30-
ENV GO111MODULE on
29+
ENV GO111MODULE=on
3130
ARG CGO_ENABLED
32-
ENV CGO_ENABLED ${CGO_ENABLED}
31+
ENV CGO_ENABLED=${CGO_ENABLED}
3332
ARG GOTOOLCHAIN
34-
ENV GOTOOLCHAIN ${GOTOOLCHAIN}
33+
ENV GOTOOLCHAIN=${GOTOOLCHAIN}
3534
ARG GOEXPERIMENT
36-
ENV GOEXPERIMENT ${GOEXPERIMENT}
37-
ENV GOPATH /go
35+
ENV GOEXPERIMENT=${GOEXPERIMENT}
36+
ENV GOPATH=/go
37+
ARG GOIMPORTS_VERSION
38+
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg go install golang.org/x/tools/cmd/goimports@v${GOIMPORTS_VERSION}
39+
RUN mv /go/bin/goimports /bin
3840
ARG PROTOBUF_GO_VERSION
3941
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg go install google.golang.org/protobuf/cmd/protoc-gen-go@v${PROTOBUF_GO_VERSION}
4042
RUN mv /go/bin/protoc-gen-go /bin
@@ -55,9 +57,6 @@ RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/g
5557
&& mv /go/bin/golangci-lint /bin/golangci-lint
5658
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg go install golang.org/x/vuln/cmd/govulncheck@latest \
5759
&& mv /go/bin/govulncheck /bin/govulncheck
58-
ARG GOIMPORTS_VERSION
59-
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg go install golang.org/x/tools/cmd/goimports@${GOIMPORTS_VERSION} \
60-
&& mv /go/bin/goimports /bin/goimports
6160
ARG GOFUMPT_VERSION
6261
RUN go install mvdan.cc/gofumpt@${GOFUMPT_VERSION} \
6362
&& mv /go/bin/gofumpt /bin/gofumpt
@@ -86,15 +85,12 @@ RUN gofumpt -w /api
8685
FROM base AS lint-gofumpt
8786
RUN FILES="$(gofumpt -l .)" && test -z "${FILES}" || (echo -e "Source code is not formatted with 'gofumpt -w .':\n${FILES}"; exit 1)
8887

89-
# runs goimports
90-
FROM base AS lint-goimports
91-
RUN FILES="$(goimports -l -local github.com/siderolabs/discovery-api/ .)" && test -z "${FILES}" || (echo -e "Source code is not formatted with 'goimports -w -local github.com/siderolabs/discovery-api/ .':\n${FILES}"; exit 1)
92-
9388
# runs golangci-lint
9489
FROM base AS lint-golangci-lint
9590
WORKDIR /src
9691
COPY .golangci.yml .
97-
ENV GOGC 50
92+
ENV GOGC=50
93+
RUN golangci-lint config verify --config .golangci.yml
9894
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/root/.cache/golangci-lint --mount=type=cache,target=/go/pkg golangci-lint run --config .golangci.yml
9995

10096
# runs govulncheck

0 commit comments

Comments
 (0)