lima-vm / lima-vm/lima

Embedding text files that start with multiple newlines is broken

Open
#3,424 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
21.9k
Forks
957
Avg merge
2d 6h
Merged PRs (30d)
53

Description

### Description

I believe this is a limitation of the YAML libraries we are using, so there might not be much we can do about that (this is a very longstanding issue). But we should figure out the exact conditions when things are broken, and provide a reasonable error message.

Example:

```console
❯ cat tmpl.yaml
base: template://alpine
provision:
- mode: data
file: sample.data
path: /tmp/data

❯ echo $'\nA' > sample.data
❯ limactl tmpl copy --embed-all tmpl.yaml -
WARN[0000] `base` is experimental
WARN[0000] `provision[*].file` and `probes[*].file` are experimental
provision:
- mode: data
content: |
A
path: /tmp/data

❯ echo $'\n\nA' > sample.data
❯ limactl tmpl copy --embed-all tmpl.yaml -
WARN[0000] `base` is experimental
WARN[0000] `provision[*].file` and `probes[*].file` are experimental
FATA[0000] yaml: line 1: did not find expected key
``

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.