Can I use a dynamic tag for a task's image in concourse?

Hello all!

I am facing a desing issue that I can’t figure out by myself. the TL;DR is the following:

I am deploying a helm chart to kubernetes on one step that has a well defined (semver) variable/file and its container is is also tagged with the semver on circle ci. The next step needs to run a container (which is also built and tagged at the same time as the chart container and is also built on circle ci) that’s on the same tag as the chart container from earlier, and there is where I am lost. I can’t find a way to make concourse only pull the specific tag for the component-tests container and not just rely on latest (relying on the latest tag for the component tests can and has blocked deploying in environments later on). Here’s a sample concourse file of what I am trying to do:

resource_types:
  - name: gcs-resource
    type: docker-image
    source:
      repository: frodenas/gcs-resource
resources:
  - name: component-tests
    type: docker-image
    source:
      repository: xyz
      tag: latest
      username: _json_key
      password: xyz
  - name: platform-helm
    type: docker-image
    source:
      repository: xyz
      tag: latest
      username: _json_key
      password: xyz
  - name: service-version
    type: gcs-resource
    source:
      bucket: xyz
      json_key: xyz
      regexp: xyz
  - name: deploy-scripts
    type: gcs-resource
    source:
      bucket: xyz
      json_key: xyz
      regexp: xyz
jobs:
- name: deploy-canary-dev
  plan:
    - get: register-dns
    - get: platform-helm
    - get: service-version
      trigger: true
      params:
        unpack: true
    - get: deploy-scripts
      params:
        unpack: true
    - do:
      - task: deploy-helm-chart-dev
        image: platform-helm
        file: deploy-chart.yml
        params:
          ENV: dev
- name: component-tests-dev
  plan:
    - get: component-tests
    - get: service-version
      trigger: true
      params:
        unpack: true
      passed: [deploy-canary-dev]
    - get: deploy-scripts
      params:
        unpack: true
    - task: component-tests
      file:  run-component-tests.yml
      image: component-tests
      params:
        ENV: someName
groups:
    - name: dev
      jobs:
        - deploy-canary-dev
        - component-tests-dev

Am I going about it the wrong way? Is this even possible in concourse?! I would rather avoid launching a container from a priviledged container, so if there’s another workaround I’d rather do that first!

currently not possible until something like “spaces” (v6)

docker image resource tracks a single tag, which itself points to an underlying image digest. that digest is the actual version that is surfaced.

for what you’re trying to do, you’d probably need meta pipelines

e.g. you’d have a pipeline that knows how to build a single image tag (what you have currently)

then you have another pipeline that would have a resource that’s aware of all the tags for that image, and for each tag, can call set-pipeline and create a pipeline for that tag

https://github.com/concourse/concourse-pipeline-resource might be able to help

1 Like

ah that’s a shame, but I suspected this would be the case. Thanks very much for your help!