Skip to content

Error with dynamic across value interpolation #63

@Fyrsta

Description

@Fyrsta

Hi,

I'm having problems with using a varabilized input for across values. I've put together an example below to replicate.

If I replace values: ((.:config.versions)) with something hardcoded, everything runs fine as expected. However, with a variable it's not happy and breaks, but manually setting the pipeline through fly works.

Any help on this would be greatly appreciated, thanks!

Example config:

pipeline.yml:

jobs:
  - name: hello
    plan:
      - { load_var: config, file: config.yml, format: "yml" }
      - across:
          - var: version
            values: ((.:config.versions))
        task: say-hello
        config:
          platform: linux
          image_resource: { type: registry-image , source: { repository: "busybox" }}
          run: { path: echo , args: [ "Hello", ((.:version)),  "!" ] }

config.yml:

  versions:
    - a
    - b
    - c

main.tf:

terraform {
  required_providers {
    concourse = {
      source = "terraform-provider-concourse/concourse"
      version = "8.0.1"
    }
  }
}

provider "concourse" {
  target = "<target>"
}

resource "concourse_pipeline" "pipeline_test" {
  is_exposed = false
  is_paused = false
  pipeline_config = file("pipeline.yml")
  pipeline_config_format = "yaml"
  pipeline_name = "pipeline-test"
  team_name = "<team>"
}

I can run the following: fly -t <target> set-pipeline --pipeline pipeline-test --config pipeline.yml fine, but with either an apply through Terraform before the pipeline is applied (note, it will apply fine and show up in Concourse, but still show the error) or any subsequent applies afterwards, results in:

│ Error: Error reading pipeline pipeline-test from team '<team>': Error looking up pipeline pipeline-test within team '<team>': malformed across step: json: cannot unmarshal string into Go struct field AcrossStep.across of type []interface {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions