Skip to content

Commit f57e58d

Browse files
committed
chore(deps): update golangci-lint
Signed-off-by: Sven Pfennig <[email protected]>
1 parent 830dc2b commit f57e58d

File tree

7 files changed

+15
-14
lines changed

7 files changed

+15
-14
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2828
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
2929
with:
30-
go-version: "1.21"
30+
go-version: "1.23"
3131
- run: make test
3232

3333
golangci:
@@ -37,9 +37,9 @@ jobs:
3737
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3838
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
3939
with:
40-
go-version: "1.21"
40+
go-version: "1.23"
4141
- name: golangci-lint
4242
uses: golangci/golangci-lint-action@ec5d18412c0aeab7936cb16880d708ba2a64e1ae # v6.2.0
4343
with:
44-
version: v1.57.2
44+
version: v1.63.4
4545
skip-cache: true

.golangci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,19 +188,19 @@ linters:
188188
- asasalint # checks for pass []any as any in variadic func(...any)
189189
- asciicheck # checks that your code does not contain non-ASCII identifiers
190190
- bidichk # checks for dangerous unicode character sequences
191+
- copyloopvar # Copyloopvar is a linter detects places where loop variables are copied.
191192
- cyclop # checks function and package cyclomatic complexity
192193
- dupl # tool for code clone detection
193194
- errname # checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error
194195
- errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13
195-
- exportloopref # checks for pointers to enclosing loop variables
196196
- forbidigo # forbids identifiers
197197
- funlen # tool for detection of long functions
198198
- gocognit # computes and checks the cognitive complexity of functions
199199
- goconst # finds repeated strings that could be replaced by a constant
200200
- gocritic # provides diagnostics that check for bugs, performance and style issues
201201
- gocyclo # computes and checks the cyclomatic complexity of functions
202202
- goimports # in addition to fixing imports, goimports also formats your code in the same style as gofmt
203-
- gomnd # detects magic numbers
203+
- mnd # detects magic numbers
204204
- goprintffuncname # checks that printf-like functions are named with f at the end
205205
- gosec # inspects source code for security problems
206206
- makezero # finds slice declarations with non-zero initial length

internal/containerd/configure.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (c *Config) AddRuntime(shimPath string) error {
6464
}
6565

6666
// Open file in append mode
67-
file, err := c.hostFs.OpenFile(c.configPath, os.O_APPEND|os.O_WRONLY, 0o644) //nolint:gomnd // file permissions
67+
file, err := c.hostFs.OpenFile(c.configPath, os.O_APPEND|os.O_WRONLY, 0o644) //nolint:mnd // file permissions
6868
if err != nil {
6969
return err
7070
}
@@ -101,7 +101,7 @@ func (c *Config) RemoveRuntime(shimPath string) (changed bool, err error) {
101101
modifiedData := strings.ReplaceAll(string(data), cfg, "")
102102

103103
// Write the modified data back to the file.
104-
err = afero.WriteFile(c.hostFs, c.configPath, []byte(modifiedData), 0o644) //nolint:gomnd // file permissions
104+
err = afero.WriteFile(c.hostFs, c.configPath, []byte(modifiedData), 0o644) //nolint:mnd // file permissions
105105
if err != nil {
106106
return false, err
107107
}

internal/controller/shim_controller.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const (
4848
UNINSTALL = "uninstall"
4949
ProvisioningStatusProvisioned = "provisioned"
5050
ProvisioningStatusPending = "pending"
51+
K8sNameMaxLength = 63
5152
)
5253

5354
// ShimReconciler reconciles a Shim object
@@ -385,7 +386,7 @@ func (sr *ShimReconciler) createJobManifest(shim *rcmv1.Shim, node *corev1.Node,
385386
sr.setOperationConfiguration(shim, &opConfig)
386387

387388
name := node.Name + "-" + shim.Name + "-" + operation
388-
nameMax := int(math.Min(float64(len(name)), 63))
389+
nameMax := int(math.Min(float64(len(name)), K8sNameMaxLength))
389390

390391
job := &batchv1.Job{
391392
TypeMeta: metav1.TypeMeta{
@@ -498,7 +499,7 @@ func (sr *ShimReconciler) handleDeployRuntimeClass(ctx context.Context, shim *rc
498499
// createRuntimeClassManifest creates a RuntimeClass manifest for a Shim.
499500
func (sr *ShimReconciler) createRuntimeClassManifest(shim *rcmv1.Shim) (*nodev1.RuntimeClass, error) {
500501
name := shim.Spec.RuntimeClass.Name
501-
nameMax := int(math.Min(float64(len(name)), 63))
502+
nameMax := int(math.Min(float64(len(name)), K8sNameMaxLength))
502503

503504
nodeSelector := shim.Spec.NodeSelector
504505
if nodeSelector == nil {

internal/shim/install.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@ import (
2828

2929
func (c *Config) Install(shimName string) (filePath string, changed bool, err error) {
3030
shimPath := filepath.Join(c.assetPath, shimName)
31-
srcFile, err := c.rootFs.OpenFile(shimPath, os.O_RDONLY, 0o000) //nolint:gomnd // file permissions
31+
srcFile, err := c.rootFs.OpenFile(shimPath, os.O_RDONLY, 0o000) //nolint:mnd // file permissions
3232
if err != nil {
3333
return "", false, err
3434
}
3535
dstFilePath := path.Join(c.kwasmPath, "bin", shimName)
3636

37-
err = c.hostFs.MkdirAll(path.Dir(dstFilePath), 0o775) //nolint:gomnd // file permissions
37+
err = c.hostFs.MkdirAll(path.Dir(dstFilePath), 0o775) //nolint:mnd // file permissions
3838
if err != nil {
3939
return dstFilePath, false, err
4040
}
4141

42-
dstFile, err := c.hostFs.OpenFile(dstFilePath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o755) //nolint:gomnd // file permissions
42+
dstFile, err := c.hostFs.OpenFile(dstFilePath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o755) //nolint:mnd // file permissions
4343
if err != nil {
4444
return "", false, err
4545
}

internal/state/state.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,5 @@ func (l *State) Write() error {
6060

6161
slog.Debug("writing lock file", "content", string(out))
6262

63-
return afero.WriteFile(l.fs, l.lockFilePath, out, 0644) //nolint:gomnd // file permissions
63+
return afero.WriteFile(l.fs, l.lockFilePath, out, 0644) //nolint:mnd // file permissions
6464
}

tests/node-installer/fs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func FixtureFs(fixturePath string) afero.Fs {
1515
return err
1616
}
1717
if info.IsDir() {
18-
return fs.MkdirAll(path, 0755) //nolint:gomnd // file permissions
18+
return fs.MkdirAll(path, 0755) //nolint:mnd // file permissions
1919
}
2020
src, err := baseFs.Open(path)
2121
if err != nil {

0 commit comments

Comments
 (0)