garden-io / garden

Automation for Kubernetes development and testing. Spin up production-like environments for development, testing, and CI on demand. Use the same configuration and workflows at every step of the process. Speed up your builds and test runs via shared result caching
https://garden.io
Mozilla Public License 2.0
3.33k stars 269 forks source link

0.13: [Bug]: deploy actions resolve template strings in manifests in a way that breaks for multi-line strings #5266

Open stefreak opened 11 months ago

stefreak commented 11 months ago

Garden Bonsai (0.13) Bug

Current Behavior

Error cannot parse yaml with multiline string in variable templated to a manifest file

Expected behavior

Should work.

Reproducible example

manifest:

apiVersion: v1
kind: ConfigMap
metadata:
  name: test-configmap
data:
  hello: ${var.multiline-var}

deploy action:

kind: Deploy
type: kubernetes
name: multiline-var-in-manifest-deploy
spec:
  files: [ "deployment.yml" ]
variables:
  multiline-var: |
    this is a
    multiline
    variable
  foo: bar

Workaround

Works with inline manifest

Suggested solution(s)

Resolve variables after parsing

Additional context

Your environment

garden version latest main

alexkuretz commented 6 months ago

I recently ran into this and had to b64 encode some jwt tokens, would be nice to get this fixed