Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with dynamic across value interpolation #63

Open
Fyrsta opened this issue May 30, 2023 · 0 comments
Open

Error with dynamic across value interpolation #63

Fyrsta opened this issue May 30, 2023 · 0 comments

Comments

@Fyrsta
Copy link

Fyrsta commented May 30, 2023

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 {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant