From e8807c5e53fd4b7c9507add80bac9fcbc535d54b Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 19 Dec 2021 12:46:36 +0100 Subject: [PATCH] Add "woodpeckerci/plugin-docker-buildx" to privileged plugins (#623) * refactor global const in own package * add "woodpeckerci/plugin-docker-buildx" to privileged plugins * add woodpeckerci/plugin-docker --- cli/exec/flags.go | 8 +++----- cmd/server/flags.go | 8 +++----- shared/constant/privileged_plugins.go | 9 +++++++++ 3 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 shared/constant/privileged_plugins.go diff --git a/cli/exec/flags.go b/cli/exec/flags.go index 03dca7042..68ff0cefc 100644 --- a/cli/exec/flags.go +++ b/cli/exec/flags.go @@ -18,6 +18,8 @@ import ( "time" "github.com/urfave/cli/v2" + + "github.com/woodpecker-ci/woodpecker/shared/constant" ) var flags = []cli.Flag{ @@ -53,11 +55,7 @@ var flags = []cli.Flag{ &cli.StringSliceFlag{ Name: "privileged", Usage: "privileged plugins", - Value: cli.NewStringSlice( - "plugins/docker", - "plugins/gcr", - "plugins/ecr", - ), + Value: cli.NewStringSlice(constant.PrivilegedPlugins...), }, // diff --git a/cmd/server/flags.go b/cmd/server/flags.go index eeff5521d..626022ccd 100644 --- a/cmd/server/flags.go +++ b/cmd/server/flags.go @@ -18,6 +18,8 @@ import ( "time" "github.com/urfave/cli/v2" + + "github.com/woodpecker-ci/woodpecker/shared/constant" ) var flags = []cli.Flag{ @@ -115,11 +117,7 @@ var flags = []cli.Flag{ EnvVars: []string{"WOODPECKER_ESCALATE"}, Name: "escalate", Usage: "images to run in privileged mode", - Value: cli.NewStringSlice( - "plugins/docker", - "plugins/gcr", - "plugins/ecr", - ), + Value: cli.NewStringSlice(constant.PrivilegedPlugins...), }, &cli.StringSliceFlag{ EnvVars: []string{"WOODPECKER_VOLUME"}, diff --git a/shared/constant/privileged_plugins.go b/shared/constant/privileged_plugins.go new file mode 100644 index 000000000..7584832d9 --- /dev/null +++ b/shared/constant/privileged_plugins.go @@ -0,0 +1,9 @@ +package constant + +var PrivilegedPlugins = []string{ + "plugins/docker", + "plugins/gcr", + "plugins/ecr", + "woodpeckerci/plugin-docker", + "woodpeckerci/plugin-docker-buildx", +}