enforce plugin whitelist for notifications
This commit is contained in:
parent
906bbe9cc5
commit
f76dcb1171
3 changed files with 14 additions and 10 deletions
|
@ -54,6 +54,7 @@ func main() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorln("Error starting build server pod", err)
|
log.Errorln("Error starting build server pod", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
ctx.client = client
|
ctx.client = client
|
||||||
defer client.Destroy()
|
defer client.Destroy()
|
||||||
|
@ -65,6 +66,7 @@ func main() {
|
||||||
log.Errorln("Error processing .drone.yml file.", err)
|
log.Errorln("Error processing .drone.yml file.", err)
|
||||||
client.Destroy()
|
client.Destroy()
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var execs []execFunc
|
var execs []execFunc
|
||||||
|
|
|
@ -190,12 +190,14 @@ func (r *Runner) Run(w *queue.Work) error {
|
||||||
// the destroy all containers afterward.
|
// the destroy all containers afterward.
|
||||||
for i, build := range w.Commit.Builds {
|
for i, build := range w.Commit.Builds {
|
||||||
work := &work{
|
work := &work{
|
||||||
Repo: w.Repo,
|
Repo: w.Repo,
|
||||||
Commit: w.Commit,
|
Commit: w.Commit,
|
||||||
Keys: w.Keys,
|
Keys: w.Keys,
|
||||||
Netrc: w.Netrc,
|
Netrc: w.Netrc,
|
||||||
Yaml: w.Yaml,
|
Yaml: w.Yaml,
|
||||||
Build: build,
|
Build: build,
|
||||||
|
Env: w.Env,
|
||||||
|
Plugins: w.Plugins,
|
||||||
}
|
}
|
||||||
in, err := json.Marshal(work)
|
in, err := json.Marshal(work)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -77,10 +77,6 @@ func ParseSingle(raw string, opts *Opts) (*common.Config, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
err = LintPlugins(conf, opts)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
// apply rules / transofms
|
// apply rules / transofms
|
||||||
transformSetup(conf)
|
transformSetup(conf)
|
||||||
transformClone(conf)
|
transformClone(conf)
|
||||||
|
@ -96,6 +92,10 @@ func ParseSingle(raw string, opts *Opts) (*common.Config, error) {
|
||||||
if !opts.Privileged {
|
if !opts.Privileged {
|
||||||
rmPrivileged(conf)
|
rmPrivileged(conf)
|
||||||
}
|
}
|
||||||
|
err = LintPlugins(conf, opts)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
return conf, err
|
return conf, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue