mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-04 09:44:13 +00:00
Add user as docker backend_option (#4526)
This commit is contained in:
21
pipeline/backend/docker/backend_options.go
Normal file
21
pipeline/backend/docker/backend_options.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package docker
|
||||
|
||||
import (
|
||||
"github.com/mitchellh/mapstructure"
|
||||
|
||||
backend "go.woodpecker-ci.org/woodpecker/v2/pipeline/backend/types"
|
||||
)
|
||||
|
||||
// BackendOptions defines all the advanced options for the docker backend.
|
||||
type BackendOptions struct {
|
||||
User string `mapstructure:"user"`
|
||||
}
|
||||
|
||||
func parseBackendOptions(step *backend.Step) (BackendOptions, error) {
|
||||
var result BackendOptions
|
||||
if step == nil || step.BackendOptions == nil {
|
||||
return result, nil
|
||||
}
|
||||
err := mapstructure.Decode(step.BackendOptions[EngineName], &result)
|
||||
return result, err
|
||||
}
|
Reference in New Issue
Block a user