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

fix(template): support template strings in ConfigTemplate.configs #5796

Merged
merged 5 commits into from
Mar 4, 2024

Conversation

vvagaytsev
Copy link
Collaborator

@vvagaytsev vvagaytsev commented Mar 4, 2024

What this PR does / why we need it:

Prior to this PR Garden did not allow the templating in the ConfigTemplate.configs like this:

kind: ConfigTemplate
name: runs-template
inputsSchemaPath: schema.json

configs:
  - $concat:
      $forEach: ${inputs.names}
      $return:
        kind: Run
        type: exec
        name: "${item.value}"
        spec:
          command: ["echo", "${item.value}"]

---
kind: RenderTemplate
template: runs-template
name: my-runs
inputs:
  names: ["run-a", "run-b"]

and it failed with error:

Unexpected kind 'undefined' found in ConfigTemplate 'runs-template'. Supported kinds are: Build, Deploy, Run, Test and Workflow
Click to expand schema.json
{
  "type": "object",
  "properties": {
    "names": {
      "type": "array"
    }
  }
}

Now, Garden partially resolves the configs field of a given ConfigTemplate.

@vvagaytsev vvagaytsev requested a review from thsig March 4, 2024 11:18
@vvagaytsev vvagaytsev marked this pull request as ready for review March 4, 2024 13:13
@vvagaytsev vvagaytsev added this pull request to the merge queue Mar 4, 2024
Merged via the queue into main with commit bf51aa0 Mar 4, 2024
40 checks passed
@vvagaytsev vvagaytsev deleted the fix/templating-in-template-configs branch March 4, 2024 14:25
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

Successfully merging this pull request may close these issues.

2 participants