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

Render of multiline string breaks pretty yaml printing in certain cases #5343

Closed
1 task done
distorhead opened this issue Mar 2, 2023 · 1 comment
Closed
1 task done

Comments

@distorhead
Copy link
Member

Before proceeding

  • I didn't find a similar issue

Version

1.2.204

How to reproduce

Define a manifest with string-value as multiline yaml which contains empty string with number of spaces more than identation level:

---$
apiVersion: v1$
kind: ConfigMap$
metadata:$
  name: cm$
data:$
  stringkey: |$
    hello: world$
     $
    test: value$

Note that after hello: world there is 5 spaces, while identation of string value yaml is 4 spaces.

Result

Run werf render (or werf helm template .helm):

# Source: test/templates/cm.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: cm
  annotations:
    project.werf.io/env: ""
    project.werf.io/name: x
    werf.io/version: dev
data:
  stringkey: "hello: world\n \ntest: value\n"

stringkey value is no more multiline string.

Expected result

Running vanilla helm template .helm does not break multiline representation of stringkey:

---
# Source: test/templates/cm.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: cm
data:
  stringkey: |
    hello: world
     
    test: value

Additional information

No response

@alexey-igrychev
Copy link
Member

rel #5344

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

2 participants