Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(patch/v25.2): dereference outputs ctn config #614

Merged
merged 1 commit into from
Nov 1, 2024
Merged
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
9 changes: 6 additions & 3 deletions cmd/vela-worker/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
// exec is a helper function to poll the queue
// and execute Vela pipelines for the Worker.
//
//nolint:nilerr,funlen // ignore returning nil - don't want to crash worker

Check failure on line 30 in cmd/vela-worker/exec.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] cmd/vela-worker/exec.go#L30

directive `//nolint:nilerr,funlen // ignore returning nil - don't want to crash worker` is unused for linter "nilerr" (nolintlint)
Raw output
cmd/vela-worker/exec.go:30:1: directive `//nolint:nilerr,funlen // ignore returning nil - don't want to crash worker` is unused for linter "nilerr" (nolintlint)
//nolint:nilerr,funlen // ignore returning nil - don't want to crash worker
^
func (w *Worker) exec(index int, config *api.Worker) error {

Check failure on line 31 in cmd/vela-worker/exec.go

View workflow job for this annotation

GitHub Actions / diff-review

cyclomatic complexity 31 of func `(*Worker).exec` is high (> 30) (gocyclo)

Check failure on line 31 in cmd/vela-worker/exec.go

View workflow job for this annotation

GitHub Actions / full-review

cyclomatic complexity 31 of func `(*Worker).exec` is high (> 30) (gocyclo)

Check failure on line 31 in cmd/vela-worker/exec.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] cmd/vela-worker/exec.go#L31

cyclomatic complexity 31 of func `(*Worker).exec` is high (> 30) (gocyclo)
Raw output
cmd/vela-worker/exec.go:31:1: cyclomatic complexity 31 of func `(*Worker).exec` is high (> 30) (gocyclo)
func (w *Worker) exec(index int, config *api.Worker) error {
^
var err error

// setup the version
Expand Down Expand Up @@ -146,8 +146,11 @@
break
}

// set the outputs container ID
w.Config.Executor.OutputCtn.ID = fmt.Sprintf("outputs_%s", p.ID)
// dereference configured outputs ctn config and set the outputs container ID for the executor
//
// need to dereference to avoid executors sharing the last set outputs container config
execOutputCtn := *w.Config.Executor.OutputCtn
execOutputCtn.ID = fmt.Sprintf("outputs_%s", p.ID)

// create logger with extra metadata
//
Expand Down Expand Up @@ -240,7 +243,7 @@
Build: item.Build,
Pipeline: p.Sanitize(w.Config.Runtime.Driver),
Version: v.Semantic(),
OutputCtn: w.Config.Executor.OutputCtn,
OutputCtn: &execOutputCtn,
})

// add the executor to the worker
Expand Down
Loading