Unknown/extra 键:- 工作[0].计划[1].image_resource

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

我正在尝试使用所需图像更新管道。当我在第一份工作中使用此配置时:

- 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:
          - ...
          - ...

我收到这个错误:

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

什么会导致此错误?

image_resource 键仅存在于任务配置中,因此您的作业可能类似于:

- 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:
          - ...
          - ...

我不确定您的 &cli 应该指的是什么,但您不需要它。您应该拥有的就是此处定义的内容:https://concourse-ci.org/single-page.html#image_resource