Unknown/extra keys: - jobs[0].plan[1].image_resource

1.6k Views Asked by At

I'm trying to update a pipeline with a needed image. When I use this configuration for my first job:

- name: deploy
  plan:
  - aggregate:
    - get: go-time
      trigger: true
    - get: github-repo
  - task: deploy-<product>
    image_resource: &cli
      type: docker-image
      source:
        repository: <repo>/<image>
        tag: latest
    config:
      platform: linux
      inputs:
      - name: github-repo
      outputs:
      - name: current-deployment-id
        path: deployment_meta
      run:
        path: github-repo/ci/scripts/deploy.sh
        args:
          - ...
          - ...

I get this error:

unknown/extra keys:
  - jobs[0].plan[1].image_resource

What would cause this error?

1

There are 1 best solutions below

1
On BEST ANSWER

The image_resource key only exists inside of a task config, so your job should probably look something like:

- name: deploy
  plan:
  - aggregate:
    - get: go-time
      trigger: true
    - get: github-repo
  - task: deploy-<product>
    config:
      platform: linux
      image_resource:
        type: docker-image
        source:
          repository: <repo>/<image>
          tag: latest
      inputs:
      - name: github-repo
      outputs:
      - name: current-deployment-id
        path: deployment_meta
      run:
        path: github-repo/ci/scripts/deploy.sh
        args:
          - ...
          - ...

I am not sure what the &cli you have is supposed to refer to, but you shouldn't need it. All you should have is what is defined here: https://concourse-ci.org/single-page.html#image_resource.