Skip to content

Merge branch 'main' into bump/docker-v27 #4679

Merge branch 'main' into bump/docker-v27

Merge branch 'main' into bump/docker-v27 #4679

GitHub Actions / golangci failed Sep 20, 2024 in 2s

reviewdog [golangci] report

reported by reviewdog 🐶

Findings (59)

internal/context/context_test.go|132 col 4| if statements should only be cuddled with assignments (wsl)
internal/context/context_test.go|148 col 4| assignments should only be cuddled with other assignments (wsl)
internal/context/context_test.go|149 col 4| only one cuddle assignment allowed before if statement (wsl)
mock/worker/executor.go|38 col 13| SA1019: library.Executor is deprecated: use Executor from github.com/go-vela/server/api/types instead. (staticcheck)
mock/worker/executor.go|58 col 11| SA1019: library.Executor is deprecated: use Executor from github.com/go-vela/server/api/types instead. (staticcheck)
runtime/docker/build.go|13 col 31| unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
runtime/docker/build.go|21 col 29| unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
runtime/docker/build.go|29 col 30| unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
runtime/docker/container.go|303 col 16| SA1019: types.ExecConfig is deprecated: use [container.ExecOptions]. (staticcheck)
runtime/docker/container.go|315 col 78| SA1019: types.ExecStartCheck is deprecated: use [container.ExecStartOptions] or [container.ExecAttachOptions]. (staticcheck)
runtime/docker/network.go|23 col 10| SA1019: types.NetworkCreate is deprecated: use [network.CreateOptions]. (staticcheck)
runtime/docker/network.go|45 col 10| SA1019: types.NetworkInspectOptions is deprecated: use [network.InspectOptions]. (staticcheck)
runtime/kubernetes/mock.go|143 col 53| Error return value of (k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler is not checked (errcheck)
runtime/kubernetes/pod_tracker.go|226 col 40| Error return value of (k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler is not checked (errcheck)
runtime/kubernetes/pod_tracker_test.go|184 col 25| unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
runtime/kubernetes/pod_tracker_test.go|258 col 25| unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
runtime/kubernetes/pod_tracker_test.go|327 col 25| unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
runtime/kubernetes/pod_tracker_test.go|373 col 4| expressions should not be cuddled with blocks (wsl)
mock/docker/container.go|127 col 9| SA1019: types.ContainerExecInspect is deprecated: use [container.ExecInspect]. (staticcheck)
mock/docker/container.go|388 col 9| SA1019: types.ContainerPathStat is deprecated: use [container.PathStat]. (staticcheck)
mock/docker/container.go|397 col 9| SA1019: types.ContainerStats is deprecated: use [container.StatsResponseReader]. (staticcheck)
mock/docker/container.go|495 col 9| SA1019: types.ContainersPruneReport is deprecated: use [container.PruneReport]. (staticcheck)
mock/docker/container.go|503 col 9| SA1019: types.ContainerStats is deprecated: use [container.StatsResponseReader]. (staticcheck)
mock/docker/container.go|511 col 14| SA1019: types.ContainerPathStat is deprecated: use [container.PathStat]. (staticcheck)
mock/docker/network.go|40 col 10| SA1019: types.NetworkCreateResponse is deprecated: use [network.CreateResponse]. (staticcheck)
mock/docker/network.go|47 col 10| SA1019: types.NetworkCreateResponse is deprecated: use [network.CreateResponse]. (staticcheck)
mock/docker/network.go|56 col 10| SA1019: types.NetworkCreateResponse is deprecated: use [network.CreateResponse]. (staticcheck)
mock/docker/network.go|84 col 10| SA1019: types.NetworkResource is deprecated: use [network.Inspect] or [network.Summary] (for list operations). (staticcheck)
mock/docker/network.go|89 col 10| SA1019: types.NetworkResource is deprecated: use [network.Inspect] or [network.Summary] (for list operations). (staticcheck)
mock/docker/network.go|96 col 10| SA1019: types.NetworkResource is deprecated: use [network.Inspect] or [network.Summary] (for list operations). (staticcheck)
mock/docker/network.go|176 col 9| SA1019: types.NetworksPruneReport is deprecated: use [network.PruneReport]. (staticcheck)
mock/docker/volume.go|173 col 9| SA1019: types.VolumesPruneReport is deprecated: use [volume.PruneReport]. (staticcheck)
cmd/vela-worker/exec.go|31 col 1| cyclomatic complexity 31 of func (*Worker).exec is high (> 30) (gocyclo)
executor/local/build_test.go|470 col 19| unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
executor/local/build_test.go|515 col 19| unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
executor/linux/build_test.go|1100 col 19| unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
executor/linux/secret.go|209 col 37| non-wrapping format verb for fmt.Errorf. Use %w to format errors (errorlint)
executor/linux/secret.go|226 col 37| non-wrapping format verb for fmt.Errorf. Use %w to format errors (errorlint)
executor/linux/secret.go|243 col 37| non-wrapping format verb for fmt.Errorf. Use %w to format errors (errorlint)
cmd/vela-worker/start.go|54 col 4| expressions should not be cuddled with blocks (wsl)
cmd/vela-worker/start.go|57 col 4| assignments should only be cuddled with other assignments (wsl)
cmd/vela-worker/start.go|58 col 4| only one cuddle assignment allowed before if statement (wsl)
cmd/vela-worker/start.go|61 col 4| return statements should not be cuddled if block has more than two lines (wsl)
cmd/vela-worker/start.go|70 col 3| expressions should not be cuddled with declarations or returns (wsl)
cmd/vela-worker/start.go|71 col 3| if statements should only be cuddled with assignments (wsl)
cmd/vela-worker/start.go|50 col 4| assignments should only be cuddled with other assignments (wsl)
cmd/vela-worker/start.go|51 col 4| only one cuddle assignment allowed before if statement (wsl)
executor/linux/build_test.go|389 col 6| if statements should only be cuddled with assignments used in the if statement itself (wsl)
executor/linux/build_test.go|992 col 4| if statements should only be cuddled with assignments (wsl)
executor/linux/build_test.go|1595 col 4| ranges should only be cuddled with assignments used in the iteration (wsl)
executor/linux/build_test.go|1757 col 4| defer statements should only be cuddled with expressions on same variable (wsl)
executor/linux/build_test.go|1483 col 4| defer statements should only be cuddled with expressions on same variable (wsl)
executor/linux/build_test.go|1600 col 6| if statements should only be cuddled with assignments used in the if statement itself (wsl)
executor/linux/build_test.go|145 col 4| defer statements should only be cuddled with expressions on same variable (wsl)
executor/linux/build_test.go|207 col 6| if statements should only be cuddled with assignments used in the if statement itself (wsl)
executor/linux/build_test.go|982 col 4| ranges should only be cuddled with assignments used in the iteration (wsl)
executor/linux/build_test.go|692 col 4| ranges should only be cuddled with assignments used in the iteration (wsl)
executor/linux/build_test.go|945 col 6| only one cuddle assignment allowed before range statement (wsl)
cmd/vela-worker/exec.go|30 col 1| directive //nolint:nilerr,funlen // ignore returning nil - don't want to crash worker is unused for linter "nilerr" (nolintlint)

Filtered Findings (0)

Annotations

Check failure on line 132 in internal/context/context_test.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] internal/context/context_test.go#L132

if statements should only be cuddled with assignments (wsl)
Raw output
internal/context/context_test.go:132:4: if statements should only be cuddled with assignments (wsl)
			if e := ctx.Err(); e != nil {
			^

Check failure on line 148 in internal/context/context_test.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] internal/context/context_test.go#L148

assignments should only be cuddled with other assignments (wsl)
Raw output
internal/context/context_test.go:148:4: assignments should only be cuddled with other assignments (wsl)
			lastLogEntry := loggerHook.LastEntry()
			^

Check failure on line 149 in internal/context/context_test.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] internal/context/context_test.go#L149

only one cuddle assignment allowed before if statement (wsl)
Raw output
internal/context/context_test.go:149:4: only one cuddle assignment allowed before if statement (wsl)
			if lastLogEntry.Message != test.lastLogMessage {
			^

Check failure on line 38 in mock/worker/executor.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] mock/worker/executor.go#L38

SA1019: library.Executor is deprecated: use Executor from github.com/go-vela/server/api/types instead. (staticcheck)
Raw output
mock/worker/executor.go:38:13: SA1019: library.Executor is deprecated: use Executor from github.com/go-vela/server/api/types instead. (staticcheck)
	var body []library.Executor
	           ^

Check failure on line 58 in mock/worker/executor.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] mock/worker/executor.go#L58

SA1019: library.Executor is deprecated: use Executor from github.com/go-vela/server/api/types instead. (staticcheck)
Raw output
mock/worker/executor.go:58:11: SA1019: library.Executor is deprecated: use Executor from github.com/go-vela/server/api/types instead. (staticcheck)
	var body library.Executor
	         ^

Check failure on line 13 in runtime/docker/build.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] runtime/docker/build.go#L13

unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
Raw output
runtime/docker/build.go:13:31: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
func (c *client) InspectBuild(ctx context.Context, b *pipeline.Build) ([]byte, error) {
                              ^

Check failure on line 21 in runtime/docker/build.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] runtime/docker/build.go#L21

unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
Raw output
runtime/docker/build.go:21:29: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
func (c *client) SetupBuild(ctx context.Context, b *pipeline.Build) error {
                            ^

Check failure on line 29 in runtime/docker/build.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] runtime/docker/build.go#L29

unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
Raw output
runtime/docker/build.go:29:30: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
func (c *client) StreamBuild(ctx context.Context, b *pipeline.Build) error {
                             ^

Check failure on line 303 in runtime/docker/container.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] runtime/docker/container.go#L303

SA1019: types.ExecConfig is deprecated: use [container.ExecOptions]. (staticcheck)
Raw output
runtime/docker/container.go:303:16: SA1019: types.ExecConfig is deprecated: use [container.ExecOptions]. (staticcheck)
	execConfig := types.ExecConfig{
	              ^

Check failure on line 315 in runtime/docker/container.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] runtime/docker/container.go#L315

SA1019: types.ExecStartCheck is deprecated: use [container.ExecStartOptions] or [container.ExecAttachOptions]. (staticcheck)
Raw output
runtime/docker/container.go:315:78: SA1019: types.ExecStartCheck is deprecated: use [container.ExecStartOptions] or [container.ExecAttachOptions]. (staticcheck)
	hijackedResponse, err := c.Docker.ContainerExecAttach(ctx, responseExec.ID, types.ExecStartCheck{})
	                                                                            ^

Check failure on line 23 in runtime/docker/network.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] runtime/docker/network.go#L23

SA1019: types.NetworkCreate is deprecated: use [network.CreateOptions]. (staticcheck)
Raw output
runtime/docker/network.go:23:10: SA1019: types.NetworkCreate is deprecated: use [network.CreateOptions]. (staticcheck)
	opts := types.NetworkCreate{
	        ^

Check failure on line 45 in runtime/docker/network.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] runtime/docker/network.go#L45

SA1019: types.NetworkInspectOptions is deprecated: use [network.InspectOptions]. (staticcheck)
Raw output
runtime/docker/network.go:45:10: SA1019: types.NetworkInspectOptions is deprecated: use [network.InspectOptions]. (staticcheck)
	opts := types.NetworkInspectOptions{}
	        ^

Check failure on line 143 in runtime/kubernetes/mock.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] runtime/kubernetes/mock.go#L143

Error return value of `(k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler` is not checked (errcheck)
Raw output
runtime/kubernetes/mock.go:143:53: Error return value of `(k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler` is not checked (errcheck)
	c.PodTracker.podInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
	                                                   ^

Check failure on line 226 in runtime/kubernetes/pod_tracker.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] runtime/kubernetes/pod_tracker.go#L226

Error return value of `(k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler` is not checked (errcheck)
Raw output
runtime/kubernetes/pod_tracker.go:226:40: Error return value of `(k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler` is not checked (errcheck)
	podInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
	                                      ^

Check failure on line 184 in runtime/kubernetes/pod_tracker_test.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] runtime/kubernetes/pod_tracker_test.go#L184

unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
Raw output
runtime/kubernetes/pod_tracker_test.go:184:25: unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
		t.Run(test.name, func(t *testing.T) {
		                      ^

Check failure on line 258 in runtime/kubernetes/pod_tracker_test.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] runtime/kubernetes/pod_tracker_test.go#L258

unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
Raw output
runtime/kubernetes/pod_tracker_test.go:258:25: unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
		t.Run(test.name, func(t *testing.T) {
		                      ^

Check failure on line 327 in runtime/kubernetes/pod_tracker_test.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] runtime/kubernetes/pod_tracker_test.go#L327

unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
Raw output
runtime/kubernetes/pod_tracker_test.go:327:25: unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
		t.Run(test.name, func(t *testing.T) {
		                      ^

Check failure on line 373 in runtime/kubernetes/pod_tracker_test.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] runtime/kubernetes/pod_tracker_test.go#L373

expressions should not be cuddled with blocks (wsl)
Raw output
runtime/kubernetes/pod_tracker_test.go:373:4: expressions should not be cuddled with blocks (wsl)
			tracker.Stop()
			^

Check failure on line 127 in mock/docker/container.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] mock/docker/container.go#L127

SA1019: types.ContainerExecInspect is deprecated: use [container.ExecInspect]. (staticcheck)
Raw output
mock/docker/container.go:127:9: SA1019: types.ContainerExecInspect is deprecated: use [container.ExecInspect]. (staticcheck)
	return types.ContainerExecInspect{}, nil
	       ^

Check failure on line 388 in mock/docker/container.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] mock/docker/container.go#L388

SA1019: types.ContainerPathStat is deprecated: use [container.PathStat]. (staticcheck)
Raw output
mock/docker/container.go:388:9: SA1019: types.ContainerPathStat is deprecated: use [container.PathStat]. (staticcheck)
	return types.ContainerPathStat{}, nil
	       ^

Check failure on line 397 in mock/docker/container.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] mock/docker/container.go#L397

SA1019: types.ContainerStats is deprecated: use [container.StatsResponseReader]. (staticcheck)
Raw output
mock/docker/container.go:397:9: SA1019: types.ContainerStats is deprecated: use [container.StatsResponseReader]. (staticcheck)
	return types.ContainerStats{}, nil
	       ^

Check failure on line 495 in mock/docker/container.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] mock/docker/container.go#L495

SA1019: types.ContainersPruneReport is deprecated: use [container.PruneReport]. (staticcheck)
Raw output
mock/docker/container.go:495:9: SA1019: types.ContainersPruneReport is deprecated: use [container.PruneReport]. (staticcheck)
	return types.ContainersPruneReport{}, nil
	       ^

Check failure on line 503 in mock/docker/container.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] mock/docker/container.go#L503

SA1019: types.ContainerStats is deprecated: use [container.StatsResponseReader]. (staticcheck)
Raw output
mock/docker/container.go:503:9: SA1019: types.ContainerStats is deprecated: use [container.StatsResponseReader]. (staticcheck)
	return types.ContainerStats{}, nil
	       ^

Check failure on line 511 in mock/docker/container.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] mock/docker/container.go#L511

SA1019: types.ContainerPathStat is deprecated: use [container.PathStat]. (staticcheck)
Raw output
mock/docker/container.go:511:14: SA1019: types.ContainerPathStat is deprecated: use [container.PathStat]. (staticcheck)
	return nil, types.ContainerPathStat{}, nil
	            ^

Check failure on line 40 in mock/docker/network.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] mock/docker/network.go#L40

SA1019: types.NetworkCreateResponse is deprecated: use [network.CreateResponse]. (staticcheck)
Raw output
mock/docker/network.go:40:10: SA1019: types.NetworkCreateResponse is deprecated: use [network.CreateResponse]. (staticcheck)
		return types.NetworkCreateResponse{}, errors.New("no network provided")
		       ^