buildkite/buildkite-signed-pipeline

Support plugins without arguments

zsims opened this issue · 0 comments

zsims commented

This currently errors when there's a plugin being referenced that doesn't take arguments, e.g.:

steps:
  - command: 'echo wow'
    plugins:
      - seek-oss/docker-ecr-cache#v0.0.1:
      - docker#v2.0.0:

Results in

2018/10/23 09:42:22 $ buildkite-agent pipeline upload --dry-run

2018-10-23 09:42:22 INFO   Searching for pipeline config...

2018-10-23 09:42:22 INFO   Found config file ".buildkite/pipeline.yml"

panic: interface conversion: interface {} is string, not map[string]interface {}



goroutine 1 [running]:

main.SharedSecretSigner.extractPlugins(0xc000406d50, 0x6, 0x0, 0x0, 0x852460, 0xc000410020, 0x878f40, 0xc0003d8230, 0x94, 0x10)

	/Users/zsims/projects/buildkite-signed-pipeline/signer.go:154 +0x5b5

main.SharedSecretSigner.signStep(0xc000406d50, 0x6, 0x0, 0x0, 0x878f40, 0xc000188000, 0x194, 0xc0003d81d0, 0x94, 0xc00011bac8, ...)

	/Users/zsims/projects/buildkite-signed-pipeline/signer.go:104 +0x984

main.SharedSecretSigner.Sign(0xc000406d50, 0x6, 0x0, 0x0, 0x87aa40, 0xc000074810, 0xc000000300, 0xc00011bc40, 0x81065c, 0xc00008c238)

	/Users/zsims/projects/buildkite-signed-pipeline/signer.go:57 +0x668

main.(*uploadCommand).run(0xc00007ce40, 0xc000185c20, 0x85b0e0, 0xc000073400)

	/Users/zsims/projects/buildkite-signed-pipeline/main.go:98 +0xf4

main.(*uploadCommand).run-fm(0xc000185c20, 0x409af3, 0x88f900)

	/Users/zsims/projects/buildkite-signed-pipeline/main.go:41 +0x34

gopkg.in/alecthomas/kingpin%2ev2.(*actionMixin).applyActions(0xc00018a0d8, 0xc000185c20, 0x0, 0x0)

	/Users/zsims/go/pkg/mod/gopkg.in/alecthomas/kingpin.v2@v2.2.6/actions.go:28 +0x6d

gopkg.in/alecthomas/kingpin%2ev2.(*Application).applyActions(0xc0001ac690, 0xc000185c20, 0x0, 0x0)

	/Users/zsims/go/pkg/mod/gopkg.in/alecthomas/kingpin.v2@v2.2.6/app.go:557 +0xdf

gopkg.in/alecthomas/kingpin%2ev2.(*Application).execute(0xc0001ac690, 0xc000185c20, 0xc0000733f0, 0x1, 0x1, 0x0, 0x0, 0xc0001a6960, 0x0)

	/Users/zsims/go/pkg/mod/gopkg.in/alecthomas/kingpin.v2@v2.2.6/app.go:390 +0x8f

gopkg.in/alecthomas/kingpin%2ev2.(*Application).Parse(0xc0001ac690, 0xc00007c030, 0x1, 0x1, 0x1, 0xc00008c1d0, 0x0, 0x1)

	/Users/zsims/go/pkg/mod/gopkg.in/alecthomas/kingpin.v2@v2.2.6/app.go:222 +0x1fa

main.main()

	/Users/zsims/projects/buildkite-signed-pipeline/main.go:79 +0x914

�[31m🚨 Error: The command exited with status 2�[0m