Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
run:
tests: false
timeout: 10m

linters:
disable-all: true
enable:
Expand All @@ -13,3 +14,8 @@ linters:
- unused
- govet

issues:
exclude-files:
- ".*\\.pb\\.go$"
max-issues-per-linter: 0
max-same-issues: 0
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# syntax=docker/dockerfile:1

ARG GO_VERSION=1.18.9
ARG GO_VERSION=1.21
ARG PROTOC_VERSION=3.11.4
ARG GOLANGCI_LINT_VERSION=v1.50.1
ARG GOLANGCI_LINT_VERSION=v1.57.2
ARG DEBIAN_FRONTEND=noninteractive

FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-bullseye AS gobase
Expand Down Expand Up @@ -126,7 +126,7 @@ ENV GO111MODULE=on
# install the dependencies from `make setup`
# we only copy `direct.mk` to avoid busting the cache too easily
COPY direct.mk .
COPY tools .
COPY tools ./tools
RUN make --file=direct.mk setup
# now we can copy the rest
COPY . .
Expand Down
2 changes: 1 addition & 1 deletion agent/exec/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func Do(ctx context.Context, task *api.Task, ctlr Controller) (*api.TaskStatus,
status := task.Status.Copy()

// stay in the current state.
noop := func(errs ...error) (*api.TaskStatus, error) {
noop := func(_ ...error) (*api.TaskStatus, error) {
return status, ErrTaskNoop
}

Expand Down
4 changes: 2 additions & 2 deletions agent/reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func newStatusReporter(ctx context.Context, upstream Reporter) *statusReporter {
return r
}

func (sr *statusReporter) UpdateTaskStatus(ctx context.Context, taskID string, status *api.TaskStatus) error {
func (sr *statusReporter) UpdateTaskStatus(_ context.Context, taskID string, status *api.TaskStatus) error {
sr.mu.Lock()
defer sr.mu.Unlock()

Expand All @@ -88,7 +88,7 @@ func (sr *statusReporter) UpdateTaskStatus(ctx context.Context, taskID string, s
return nil
}

func (sr *statusReporter) ReportVolumeUnpublished(ctx context.Context, volumeID string) error {
func (sr *statusReporter) ReportVolumeUnpublished(_ context.Context, volumeID string) error {
sr.mu.Lock()
defer sr.mu.Unlock()

Expand Down
4 changes: 2 additions & 2 deletions agent/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func WalkTasks(tx *bolt.Tx, fn func(task *api.Task) error) error {
return nil
}

return bkt.ForEach(func(k, v []byte) error {
return bkt.ForEach(func(k, _ []byte) error {
tbkt := bkt.Bucket(k)

p := tbkt.Get(bucketKeyData)
Expand Down Expand Up @@ -102,7 +102,7 @@ func WalkTaskStatus(tx *bolt.Tx, fn func(id string, status *api.TaskStatus) erro
return nil
}

return bkt.ForEach(func(k, v []byte) error {
return bkt.ForEach(func(k, _ []byte) error {
tbkt := bkt.Bucket(k)

p := tbkt.Get(bucketKeyStatus)
Expand Down
18 changes: 9 additions & 9 deletions agent/testutils/fakes.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type TestExecutor struct {
}

// Describe just returns empty NodeDescription.
func (e *TestExecutor) Describe(ctx context.Context) (*api.NodeDescription, error) {
func (e *TestExecutor) Describe(_ context.Context) (*api.NodeDescription, error) {
e.mu.Lock()
defer e.mu.Unlock()
if e.desc == nil {
Expand All @@ -36,7 +36,7 @@ func (e *TestExecutor) Describe(ctx context.Context) (*api.NodeDescription, erro
}

// Configure does nothing.
func (e *TestExecutor) Configure(ctx context.Context, node *api.Node) error {
func (e *TestExecutor) Configure(_ context.Context, _ *api.Node) error {
return nil
}

Expand All @@ -46,7 +46,7 @@ func (e *TestExecutor) SetNetworkBootstrapKeys([]*api.EncryptionKey) error {
}

// Controller returns TestController.
func (e *TestExecutor) Controller(t *api.Task) (exec.Controller, error) {
func (e *TestExecutor) Controller(_ *api.Task) (exec.Controller, error) {
return &TestController{
ch: make(chan struct{}),
}, nil
Expand All @@ -66,17 +66,17 @@ type TestController struct {
}

// Update does nothing.
func (t *TestController) Update(ctx context.Context, task *api.Task) error {
func (t *TestController) Update(_ context.Context, _ *api.Task) error {
return nil
}

// Prepare does nothing.
func (t *TestController) Prepare(ctx context.Context) error {
func (t *TestController) Prepare(_ context.Context) error {
return nil
}

// Start does nothing.
func (t *TestController) Start(ctx context.Context) error {
func (t *TestController) Start(_ context.Context) error {
return nil
}

Expand All @@ -90,23 +90,23 @@ func (t *TestController) Wait(ctx context.Context) error {
}

// Shutdown closes internal channel
func (t *TestController) Shutdown(ctx context.Context) error {
func (t *TestController) Shutdown(_ context.Context) error {
t.closeOnce.Do(func() {
close(t.ch)
})
return nil
}

// Terminate closes internal channel if it wasn't closed before.
func (t *TestController) Terminate(ctx context.Context) error {
func (t *TestController) Terminate(_ context.Context) error {
t.closeOnce.Do(func() {
close(t.ch)
})
return nil
}

// Remove does nothing.
func (t *TestController) Remove(ctx context.Context) error {
func (t *TestController) Remove(_ context.Context) error {
return nil
}

Expand Down
105 changes: 70 additions & 35 deletions api/types.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading