Skip to content

templates: use yq's indentation style #1389

@AkihiroSuda

Description

@AkihiroSuda

func TestEvaluateExpressionComplex(t *testing.T) {
expression := `.mounts += {"location": "foo", "mountPoint": "bar"}`
content := `
# Expose host directories to the guest, the mount point might be accessible from all UIDs in the guest
# 🟢 Builtin default: null (Mount nothing)
# 🔵 This file: Mount the home as read-only, /tmp/lima as writable
mounts:
- location: "~"
# Configure the mountPoint inside the guest.
# 🟢 Builtin default: value of location
mountPoint: null
`
// Note: yq will use canonical yaml, with indented sequences
// Note: yq will not explicitly quote strings, when not needed
expected := `
# Expose host directories to the guest, the mount point might be accessible from all UIDs in the guest
# 🟢 Builtin default: null (Mount nothing)
# 🔵 This file: Mount the home as read-only, /tmp/lima as writable
mounts:
- location: "~"
# Configure the mountPoint inside the guest.
# 🟢 Builtin default: value of location
mountPoint: null
- location: foo
mountPoint: bar
`

Lots of users are expected to use --set (yq) soon, so I'd prefer to adopt yq's indentation style.

Revert:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions