mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-22 09:51:01 +00:00
Deprecate secrets
in favor of from_secret
(#4360)
This commit is contained in:
parent
aa7e1cdd9e
commit
2cbd9268f6
2 changed files with 3 additions and 3 deletions
|
@ -186,10 +186,10 @@ func (l *Linter) lintContainerDeprecations(config *WorkflowConfig, c *types.Cont
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.Secrets.LegacyFormat {
|
if len(c.Secrets.Secrets) != 0 {
|
||||||
err = multierr.Append(err, &errorTypes.PipelineError{
|
err = multierr.Append(err, &errorTypes.PipelineError{
|
||||||
Type: errorTypes.PipelineErrorTypeDeprecation,
|
Type: errorTypes.PipelineErrorTypeDeprecation,
|
||||||
Message: "Alternative names syntax for `secrets` is deprecated, use list syntax or `from_secret` instead",
|
Message: "Secrets are deprecated, use environment with from_secret",
|
||||||
Data: errors.DeprecationErrorData{
|
Data: errors.DeprecationErrorData{
|
||||||
File: config.File,
|
File: config.File,
|
||||||
Field: fmt.Sprintf("%s.%s.secrets", field, c.Name),
|
Field: fmt.Sprintf("%s.%s.secrets", field, c.Name),
|
||||||
|
|
|
@ -175,7 +175,7 @@ func TestLintErrors(t *testing.T) {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
from: "steps: { build: { image: golang, secrets: [ { source: mysql_username, target: mysql_username } ] } }",
|
from: "steps: { build: { image: golang, secrets: [ { source: mysql_username, target: mysql_username } ] } }",
|
||||||
want: "Alternative names syntax for `secrets` is deprecated, use list syntax or `from_secret` instead",
|
want: "Secrets are deprecated, use environment with from_secret",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue