Plugin lists do not work

Related to No basic auth credentials, yet using ECR plugin

I’m opening this as another buildkite user on the Veertu slack channel was trying to use the anka plugin and seeing the problem.

Problem: Using a list of plugins does not work.

steps:
  - label: Run target
    command: whoami
    plugins:
      - chef/anka#v0.5.0:
        vm-name: bk-macos-1551961510
        debug: true
    <<: *anka

The user logs show:

:anka: Pulling from Anka Registry
-anka: action failed
🚨 Error: The command exited with status 70
Running plugin anka pre-exit hook
:anka: Cleaning up clone
Error: no such option: -0
🚨 Error: Error tearing down bootstrap: The plugin anka pre-exit hook exited with status 2

But the plugin should echo the vm-name as it’s using echo "--- :anka: Pulling $(plugin_read_config VM_NAME) from Anka Registry"

Solution: Don’t use a list.

steps:
  - label: Run target
    command: whoami
    plugins:
      chef/anka#v0.5.0:
        vm-name: bk-macos-1551961510
        debug: true
    <<: *anka

This is the same if I use the docker plugin too.

Sorry you’ve had trouble getting that working @nathan.pierce.

It looks like you might be missing one level of indentation on the array style syntax.

Can you give the following a go:

steps:
  - label: Run target
    command: whoami
    plugins:
      - chef/anka#v0.5.0:
          vm-name: bk-macos-1551961510
          debug: true
    <<: *anka

Thanks Tim! Just to be sure I understand: four spaces is needed?

Yep! The structure needs to end up as:

{
  "steps": [
    {
      "label": "Run target", 
      "command": "whoami", 
      "plugins": [
        {
          "chef/anka#v0.5.0": {
            "debug": true, 
            "vm-name": "bk-macos-1551961510"
          }
        }
      ]
    }
  ]
}

…rather than the incorrect, non-nested version, which would be:

{
  "steps": [
    {
      "label": "Run target", 
      "command": "whoami", 
      "plugins": [
        {
          "debug": true, 
          "chef/anka#v0.5.0": null, 
          "vm-name": "bk-macos-1551961510"
        }
      ]
    }
  ]
}

Works, thanks! The documentation I was using for some plugins didn’t make it clear there are four spaces needed.

1 Like