You've already forked woodpecker
mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-06-03 16:35:37 +02:00
Fix erroneous linter error for plugin privileges (#6424)
This commit is contained in:
@@ -204,7 +204,7 @@ func (l *Linter) lintImage(config *WorkflowConfig, c *types.Container, area stri
|
||||
|
||||
func (l *Linter) lintPrivilegedPlugins(config *WorkflowConfig, c *types.Container, area string) error {
|
||||
// lint for conflicts of https://github.com/woodpecker-ci/woodpecker/pull/3918
|
||||
if utils.MatchImage(c.Image, "plugins/docker", "plugins/gcr", "plugins/ecr", "woodpeckerci/plugin-docker-buildx") {
|
||||
if utils.MatchImage(c.Image, "plugins/docker", "plugins/gcr", "plugins/ecr", "woodpeckerci/plugin-docker-buildx") && !c.Privileged {
|
||||
msg := fmt.Sprintf("The formerly privileged plugin `%s` is no longer privileged by default, if required, add it to `WOODPECKER_PLUGINS_PRIVILEGED`", c.Image)
|
||||
// check first if user did not add them back
|
||||
if l.privilegedPlugins != nil && !utils.MatchImageDynamic(c.Image, *l.privilegedPlugins...) {
|
||||
|
||||
@@ -88,6 +88,9 @@ steps:
|
||||
<<: *base-step
|
||||
image: golang:latest
|
||||
`,
|
||||
}, {
|
||||
Title: "explicitly privileged container",
|
||||
Data: "{steps: { build: { image: plugins/docker, privileged: true, settings: { test: 'true' } } }, when: { branch: main, event: push } } }",
|
||||
}}
|
||||
|
||||
for _, testd := range testdatas {
|
||||
|
||||
Reference in New Issue
Block a user