carvel-dev / carvel-dev/ytt

ytt formatting converts multi line strings to single line strings due to trailing spaces

Open
#847 7 comments 3 reactions 1 assignee Claimed by @vmunishwar View on GitHub
blocked on upstream bug
Dominant language
Go
Stars
1.9k
Forks
167
PR merge metrics
No merged PRs in 30d

Description

**What steps did you take:**
I am running ytt on a config map with a multi line string and a trailing space after the colon in line 7, e.g.:

```
1 apiVersion: v1
2 kind: ConfigMap
3 metadata:
4 name: my-config.map
5 data:
6 config: |
7 metricsConfig:
8 enabled: true
9 path: /metrics
10 port: 9090
11 ignoreErrors: false
12 secure: false

```

**What happened:**
Ytt unexpectedly converts the multi-line string to a single-line string:

```
apiVersion: v1
kind: ConfigMap
metadata:
name: my-config.map
data:
config: "metricsConfig: \n enabled: true\n path: /metrics\n port: 9090\n ignoreErrors: false\n secure: false\n"
```

**What did you expect:**
The multi-line string should be kept. The trailing white space could be removed.

**Environment:**

- ytt version (use `ytt --version`): 0.44.0
- OS (e.g. from `/etc/os-release`): Ubuntu 20.04.4 LTS

---
Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.